题解 | #公共子串计算#

公共子串计算

https://www.nowcoder.com/practice/98dc82c094e043ccb7e0570e5342dd1b

str1=input()
str2=input()
res_list=[]
for i in range(len(str1)):
    for j in range(i,len(str1)+1) :
        res=str1[i:j]
        if res in str2:
  
            res_list.append(res)
len_list=[]
for d in res_list:
    len_list.append(len(d))
print(max(len_list))

全部评论

相关推荐

用微笑面对困难:只要你保证项目和获奖都是真的就行尤其是“对战,总负责人”啊这些套职,基本上队员,打杂的都这么写
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务