Last active
August 29, 2015 14:14
-
-
Save cjbottaro/19b5919cca4cdbec5830 to your computer and use it in GitHub Desktop.
Anagram detector in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def anagram?(s1, s2) | |
s1.downcase.chars.sort == s2.downcase.chars.sort | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment