Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 7
- a = [-10, 0, 1, 2, 3, 4, 5]
- m = 6
- b = [11, 0, 1, 2, 3, 11]
- l = 5
- c = [100, 0, 1, 2, 3]
- for i in range(n):
- if a[i] in b and a[i] in c:
- res = a[i]
- break
- try:
- i = a.index(res)
- j = b.index(res)
- k = c.index(res)
- length = 1
- index = 2
- while True:
- if a[i:i + index] == b[j:j + index] == c[k:k + index]:
- length += 1
- index += 1
- else:
- break
- print(length)
- except:
- print('Sequences have no subsequences')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement