题解 | #最长回文子串#
最长回文子串
http://www.nowcoder.com/practice/12e081cd10ee4794a2bd70c7d68f5507
# -*-coding:utf-8-*-
while True:
try:
input_s = input()
n = 0
for i in range(len(input_s)):
for j in range(i + 1 , len(input_s) + 1):
pe_s = input_s[i:j]
l = len(pe_s)
if pe_s == pe_s[::-1] and j - i > n:
n = j - i
print(n)
except:
break