You are viewing a single comment's thread. Return to all comments →
def makeAnagram(a, b): a_counter = Counter(a) b_counter = Counter(b) a_minus_b_counter = a_counter - b_counter b_minus_a_counter = b_counter - a_counter deletions = sum(a_minus_b_counter.values()) + sum(b_minus_a_counter.values()) return deletions
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 →