You are viewing a single comment's thread. Return to all comments →
The same, but for any language. #
from collections import Counter c_a = Counter(a) c_b = Counter(b) c_common = c_b & c_a return sum( c_a.values()) + sum( c_b.values()) - 2*sum(abs(i) for i in c_common.values())
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 →
The same, but for any language. #