You are viewing a single comment's thread. Return to all comments →
def anagram(s): if (len(s) % 2 != 0): return -1 else: lst = list(s[len(s)//2:]) for i in s[:len(s)//2]: if (i in lst): lst.remove(i) return len(lst) q = int(input()) for j in range(q): s = input() result = anagram(s) print(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 →
for Python3 Platform