题解 | #密码截取#
密码截取
https://www.nowcoder.com/practice/3cd4621963e8454594f00199f4536bb1
while True: try: s = input() p = 0 for i in range(len(s)): for j in range(i,len(s)): if s[i] == s[j] and s[i+1:j] == s[i+1:j][::-1] and j + 1 - i > p: p = j + 1 - i print(p) except: break