Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = int(input())
- while t>0:
- s = input()
- i = 0
- l = []
- while i < len(s):
- j = i
- k = 0
- while j < len(s):
- st1 = s[k:j+1]
- st2 = st1[::-1]
- if st1 == st2:
- if st1 not in l:
- l.append(st1)
- k += 1
- j += 1
- i += 1
- print(len(l))
- t -= 1
Add Comment
Please, Sign In to add comment