题解 | #公共子串计算#

公共子串计算

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))

全部评论

相关推荐

06-28 22:48
已编辑
广东金融学院 Java
小浪_Coding:学院本+这俩项目不是buff叠满了嘛
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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