Skip to content

Instantly share code, notes, and snippets.

@tlehman
Created June 11, 2012 06:54
Show Gist options
  • Save tlehman/2908789 to your computer and use it in GitHub Desktop.
Save tlehman/2908789 to your computer and use it in GitHub Desktop.
anagram.rb
class String
def anagram
self.split(//).permutation.map { |a| a.join }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment