题解 | #密码截取#
密码截取
https://www.nowcoder.com/practice/3cd4621963e8454594f00199f4536bb1
def find(string): res = '' for i in range(len(string)): start = max(i - len(res) -1, 0) temp = string[start: i+1] if temp == temp[::-1]: res = temp else: temp = temp[1:] if temp == temp[::-1]: res = temp return len(res) string = input().strip() print(find(string))