Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = open("24.txt").readline()
- answ = 0
- cur = 0 #текущая длина
- a = 'LDR'
- for e in s:
- if e == a[cur % 3]:
- cur += 1
- answ = max(answ, cur)
- else:
- if e == 'L':
- cur = 1
- else:
- cur = 0
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement