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