DEV Community

Discussion on: Python challenge_7

Collapse
 
totally_chase profile image
Phantz • Edited
from collections import Counter

is_anagram = lambda x, y: Counter(x) == Counter(y)
Enter fullscreen mode Exit fullscreen mode

I'm gonna guess Counter would be able to do it pretty fast, if not the fastest.