Created
March 29, 2016 18:17
-
-
Save mutaku/174a38c4f7a2a69c011ce6fcadf321dd to your computer and use it in GitHub Desktop.
anagramamama
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
# ver a | |
def anagram(str_a, str_b): | |
return sorted([ord(x) for x in str_a]) == sorted([ord(y) for y in str_b]) | |
# ver b | |
def anagram(str_a, str_b): | |
if len(str_a) == len(str_b): | |
return sorted(str_a) == sorted(str_b) | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment