You are viewing a single comment's thread. Return to all comments →
def number_needed(a, b): dic = {} for word, value in [(a, 1), (b, -1)]: for letter in word: dic[letter] = dic.setdefault(letter, 0) + (value) return sum([abs(value) for value in dic.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 →