Skip to content

Instantly share code, notes, and snippets.

@oampo
Created January 28, 2014 15:21
Show Gist options
  • Save oampo/8669480 to your computer and use it in GitHub Desktop.
Save oampo/8669480 to your computer and use it in GitHub Desktop.
Finds whether two strings are anagrams
import sys
from collections import Counter
c1 = Counter(sys.argv[1])
c2 = Counter(sys.argv[2])
c1.subtract(c2)
print not any(c1.values())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment