题解 | #查找两个字符串a,b中的最长公共子串#
查找两个字符串a,b中的最长公共子串
https://www.nowcoder.com/practice/181a1a71c7574266ad07f9739f791506
a, b = input(), input()
if len(a) > len(b):
a, b = b, a
len_p = 0
for i in range(len(a)):
for j in range(len(a)):
if a[i:j+1] in b:
if j+1-i>len_p:
len_p = j+1-i
ans = a[i:j+1]
print(ans)

