You are viewing a single comment's thread. Return to all comments →
Great solution! Can use built-in fuction count:
def number_needed(a, b): count = 0 for i in range(97, 123): ia = a.count(chr(i)) ib = b.count(chr(i)) count += abs(ia-ib) return count
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 →
Great solution! Can use built-in fuction count: