You are viewing a single comment's thread. Return to all comments →
Python solution
def makeAnagram(a, b): counter_a = Counter(a) counter_b = Counter(b) unique_char = set(a).union(set(b)) return sum(abs(counter_a[char] - counter_b[char]) for char in unique_char)
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 →
Python solution