Created
July 28, 2020 13:04
-
-
Save FerdinaKusumah/27242ba3418d2f8076122bc60ebd45a6 to your computer and use it in GitHub Desktop.
[Python] Check if two words is anagram
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
from collections import Counter | |
"""Check if two words are anagram""" | |
a = "listen" | |
b = "silent" | |
is_anagram = Counter(a) == Counter(b) | |
# True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment