Skip to content

Instantly share code, notes, and snippets.

@yuchan
Last active August 29, 2015 14:22
Show Gist options
  • Save yuchan/2b4df1580e4d32c3bf55 to your computer and use it in GitHub Desktop.
Save yuchan/2b4df1580e4d32c3bf55 to your computer and use it in GitHub Desktop.
Altkoo
#!/usr/bin/env ruby
# coding: utf-8
# "ALTKOO"を並び替えます。
word = "ALTKOO"
carray = word.split(//)
carray.permutation.to_a.each do |elem|
p elem.join("")
end
@yuchan
Copy link
Author

yuchan commented May 30, 2015

"ALTKOO"
"ALTKOO"
"ALTOKO"
"ALTOOK"
"ALTOKO"
"ALTOOK"
"ALKTOO"
"ALKTOO"
"ALKOTO"
"ALKOOT"
"ALKOTO"
"ALKOOT"

-- (snip) --

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment