Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_len(a, b):
- if len(a) > len(b):
- a, b = b, a
- res = 0
- for i in range(-len(a) + 1, len(b)):
- cur = 0
- for j in range(len(a)):
- if 0 <= i + j < len(b) and a[j] == b[i + j]:
- cur += 1
- res = max(res, cur)
- else:
- cur = 0
- return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement