You are viewing a single comment's thread. Return to all comments →
And the Python version:
from collections import Counter
def makeAnagram(a, b): c1 = Counter(a) c2 = Counter(b) return sum(((c1-c2)+(c2-c1)).values())
Seems like cookies are disabled on this browser, please enable them to open this website
Strings: Making Anagrams
You are viewing a single comment's thread. Return to all comments →
And the Python version:
from collections import Counter
def makeAnagram(a, b): c1 = Counter(a) c2 = Counter(b) return sum(((c1-c2)+(c2-c1)).values())