You are viewing a single comment's thread. Return to all comments →
Dictionary not used.
def number_needed(a, b): ab_intersection = set(a).intersection(b) anagram = sum(min(a.count(char),b.count(char)) for char in ab_intersection) return(len(a)+len(b)-2*anagram) a = input().strip() b = input().strip() print(number_needed(a, b))
Strings: Making Anagrams
You are viewing a single comment's thread. Return to all comments →
Dictionary not used.