Skip to content

Instantly share code, notes, and snippets.

@FerdinaKusumah
Created July 28, 2020 13:04
Show Gist options
  • Save FerdinaKusumah/27242ba3418d2f8076122bc60ebd45a6 to your computer and use it in GitHub Desktop.
Save FerdinaKusumah/27242ba3418d2f8076122bc60ebd45a6 to your computer and use it in GitHub Desktop.
[Python] Check if two words is anagram
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