You are viewing a single comment's thread. Return to all comments →
n = int(raw_input()) for _ in range(n): count=0 s = raw_input() if s == s[::-1]: count="0" else: for i in range(len(s)//2): j = len(s) - i - 1 if ord(s[i]) > ord(s[j]): count+= ord(s[i]) - ord(s[j]) elif ord(s[i]) < ord(s[j]): count+= ord(s[j]) - ord(s[i]) else: next print count
Seems like cookies are disabled on this browser, please enable them to open this website
The Love-Letter Mystery
You are viewing a single comment's thread. Return to all comments →