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