Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('24-174.txt') as f:
- a = f.readlines()
- cnt = 0
- mx_ln = 0
- for i in a:
- for nd in range(len(i)-1):
- strt = i[nd]
- cnt_R = 0
- posit = nd+1
- cur_cnt = 1
- while cnt_R < 30 and posit+1 < len(i) and strt != i[posit]:
- if i[posit] == 'R':
- cnt_R += 1
- cur_cnt += 1
- posit += 1
- if i[nd] == i[posit] and cnt_R < 30 and cur_cnt >= 3:
- cnt += 1
- if mx_ln < cur_cnt:
- mx_ln = cur_cnt
- print(mx_ln, cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement