Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = open('').readline()
- cnt_x = 0
- l = 0
- r = 0
- while cnt_x == 0:
- l += 1
- r += 1
- if s[l] == 'X':
- cnt_x += 1
- answ = 1000000000
- while r < len(s):
- while r < len(s) and cnt_x != 3:
- r += 1
- if r < len(s) and s[r] == 'X':
- cnt_x += 1
- answ = min(answ, r - l + 1)
- l += 1
- while s[l] != 'X':
- l += 1
- cnt_x -= 1
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment