Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=27689
- data = open('24_demo.txt').readline()
- s = 'XYZ'
- cnt = 0 #длина текущей строки
- mx = 0 #ответ -- максимальная длина среди найденных
- for x in data: #x -- текущая буква
- if x == s[cnt % 3]:
- cnt += 1
- if cnt > mx:
- mx = cnt
- else:
- cnt = 0
- print(mx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement