nq1s788

24 соседние различные

Feb 18th, 2026
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. s = open('24_demo.txt').readline()
  2. l = 0
  3. r = 0
  4. answ = 1
  5. while r + 1 < len(s):
  6.     if s[r] != s[r + 1]:
  7.         r += 1
  8.         answ = max(answ, r - l + 1)
  9.     else:
  10.         r += 1
  11.         l = r
  12. print(answ)
Advertisement
Add Comment
Please, Sign In to add comment