题解 | #最长回文子串#
最长回文子串
https://www.nowcoder.com/practice/12e081cd10ee4794a2bd70c7d68f5507
str1 = input() l1 = [] for i in range(len(str1)): for j in range(1, len(str1)+1): a = str1[i:j] if len(a) > 0 and a[::-1] == a: l1.append(a) l2 = max(l1, key=lambda x: len(x)) print(len(l2))