题解 | #查找两个字符串a,b中的最长公共子串#
查找两个字符串a,b中的最长公共子串
https://www.nowcoder.com/practice/181a1a71c7574266ad07f9739f791506
import sys
str1=input()
str2=input()
str3=''
str4=''
if len(str1)>len(str2):
str3=str1
str4=str2
else:
str3=str2
str4=str1
jieshu=0
for i in range(len(str4),1,-1):
for j in range(0,len(str4)-i+1):
gongchuan=str4[j:j+i]
if str3.count(gongchuan)>0:
print(gongchuan)
jieshu=1
break
if jieshu==1:break
美的集团公司福利 877人发布