fork(1) download
  1. values = gets.chomp
  2. length = gets.to_i
  3.  
  4. array = values.chars
  5. puts array.permutation(length).map(&:join)
  6.  
Success #stdin #stdout 0s 6324KB
stdin
+6A
2
stdout
+6
+A
6+
6A
A+
A6