You are viewing a single comment's thread. Return to all comments →
def makingAnagrams(s1, s2): diffs = set(s1)^set(s2) commons = set(s1) & set(s2) diffscnt = sum([list(s1+s2).count(i) for i in diffs]) totalcommonremove = sum([abs(s1.count(i)-s2.count(i)) for i in commons]) result = diffscnt+totalcommonremove return result
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 →