Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = open('').readline()
- d = 0
- answ = 0
- p = 'XYZ'
- for i in range(len(s)):
- if s[i] == p[d % 3]:
- d += 1
- answ = max(answ, d)
- else:
- d = 0
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement