题解 | #公共子串计算#
公共子串计算
https://www.nowcoder.com/practice/98dc82c094e043ccb7e0570e5342dd1b
a,b=input(),input() res='' for i in range(len(a)): for j in range(i,len(a)): if a[i:j+1] in b and j+1-i>len(res): res=a[i:j+1] print(len(res))
公共子串计算
https://www.nowcoder.com/practice/98dc82c094e043ccb7e0570e5342dd1b
a,b=input(),input() res='' for i in range(len(a)): for j in range(i,len(a)): if a[i:j+1] in b and j+1-i>len(res): res=a[i:j+1] print(len(res))
相关推荐