Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=27421
- s = open('24_demo (1).txt').readline()
- l = 0
- r = 0
- answ = 1
- while r < len(s):
- if r + 1 < len(s) and s[r] != s[r + 1]:
- r += 1
- answ = max(answ, r - l + 1)
- else:
- r += 1
- l = r
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment