题解 | #最长回文子串#
最长回文子串
https://www.nowcoder.com/practice/12e081cd10ee4794a2bd70c7d68f5507
while True: try: s = input() res = '' for i in range(len(s)): start = max(0, i - len(res) - 1) tmp = s[start: i+1] if tmp == tmp[::-1]: res = tmp else: tmp = tmp[1:] if tmp == tmp[::-1]: res = tmp print(len(res)) except: break