You are viewing a single comment's thread. Return to all comments →
or even easier:
def makeAnagram(a, b): c=Counter(a) c.subtract(Counter(b)) return sum(map(abs,c.values()))
Counter.subtract does not remove negative 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 →
or even easier:
Counter.subtract does not remove negative values.