题解 | #密码截取#
密码截取
http://www.nowcoder.com/practice/3cd4621963e8454594f00199f4536bb1
import sys
for line in sys.stdin:
s=line.strip()
n = len(s)
l = []
for i in range(0,n-1):
for j in range(1,n):
if s[j] == s[i] and s[i+1:j] == s[j-1:i:-1]:
l.append(len(s[i:j+1]))
print(max(l))