题解 | #MP3光标位置#
查找两个字符串a,b中的最长公共子串
http://www.nowcoder.com/practice/181a1a71c7574266ad07f9739f791506
while True: try: a,b,res=input(),input(),'' short,long = (a,b) if len(a)<len(b) else (b,a) for i in range(len(short)): for j in range(len(short)): if short[i:j+1] in long and j+1 -i >len(res): res = short[i:j+1] print(res) except: break