Skip to content

Instantly share code, notes, and snippets.

@yock
Created March 10, 2011 04:21
Show Gist options
  • Save yock/863568 to your computer and use it in GitHub Desktop.
Save yock/863568 to your computer and use it in GitHub Desktop.
def is_anagram?(words)
one, two = words.split ", "
two_arr = two.split ""
one.chars do |o|
two_arr.delete(o) { return false }
end
true
end
puts is_anagram? "word, wrod" # => True
puts is_anagram? "word, wroo" # => False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment