You are viewing a single comment's thread. Return to all comments →
Python3 solution using Set. Faster and does not require extra import.
def makingAnagrams(s1, s2): deleted = 0 set1 = set(s1).union(set(s2)) for v in set1: deleted += abs(s1.count(v) - s2.count(v)) return deleted
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 →
Python3 solution using Set. Faster and does not require extra import.