Advertisement
nq1s788

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

Dec 20th, 2023
797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. f = open('24.txt').readline()
  2. answ = 0
  3. cur = 0
  4. for i in range(1, len(f)):
  5.     if f[i] != f[i - 1]:
  6.         cur += 1
  7.         if cur > answ:
  8.             answ = cur
  9.     else:
  10.         cur = 0
  11. print(answ + 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement