You are viewing a single comment's thread. Return to all comments →
# Anagram from collections import Counter def anagram(s): len_s = len(s) result = -1 if len_s % 2 == 0: l, r = Counter(s[:len_s // 2]), Counter(s[len_s // 2:]) result = sum((r - l).values()) return result
Seems like cookies are disabled on this browser, please enable them to open this website
Anagram
You are viewing a single comment's thread. Return to all comments →