• + 0 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