You are viewing a single comment's thread. Return to all comments →
Slidely aranged to make it more pythonic:
from string import ascii_lowercase def number_needed(a, b): count = 0 for letter in ascii_lowercase: ia = a.count(letter) ib = b.count(letter) 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 →
Slidely aranged to make it more pythonic: