题解 | #公共子串计算#
公共子串计算
https://www.nowcoder.com/practice/98dc82c094e043ccb7e0570e5342dd1b
a=input()
b=input()
'''
if len(a)>len(b):
a,b=b,a
#print(len(a)<len(b))
'''
l=[]
for i in range(len(a)):
for j in range(i+1,len(a)+1):
if a[i:j] in b:
l.append(len(a[i:j]))
if len(l)==0:
print('0') # 若没有公共子串,输出0
else:
print(max(l))