Skip to content

Instantly share code, notes, and snippets.

@radavis
Created September 5, 2013 00:50
Show Gist options
  • Select an option

  • Save radavis/6444680 to your computer and use it in GitHub Desktop.

Select an option

Save radavis/6444680 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# run via command line: ./anagrams.rb word
p ARGV[0].chars.to_a.permutation.map(&:join)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment