回答編集履歴
1
別解
test
CHANGED
@@ -15,3 +15,7 @@
|
|
15
15
|
s=gets.chomp
|
16
16
|
|
17
17
|
s.chars.permutation.to_a.flatten.join.split(%r[(#{"."*s.size})]).reject{|s| s==""}
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
gets.chomp.chars.permutation.inject([]){|ary,perm| ary << perm.join}
|