You are viewing a single comment's thread. Return to all comments →
a simple Python solution
def makingAnagrams(s1, s2): #common letters cl = set(s1) & set(s2) #reusable letters rl = 0 for l in cl: rl += min(s1.count(l), s2.count(l)) return len(s1) + len(s2)-rl * 2
Seems like cookies are disabled on this browser, please enable them to open this website
Making Anagrams
You are viewing a single comment's thread. Return to all comments →
a simple Python solution