Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import product
- f = open('24-157.txt')
- frst = f.read(1)
- cnt, cur_cnt = 1, 1
- cmb = list(product('PQR', repeat=2))
- while scnd := f.read(1):
- if tuple(frst+scnd) not in cmb:
- cur_cnt += 1
- if cur_cnt > cnt:
- cnt = cur_cnt
- else:
- cur_cnt = 1
- frst = scnd
- print(cnt)
Add Comment
Please, Sign In to add comment