Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open('24.txt')
- s = f.readline()
- f.close()
- def d(x,y):
- global s
- s = s.replace(x,y)
- d('A', 'X')
- d('C', 'X')
- d('D', 'X')
- d('B', 'Y')
- d('E', 'Y')
- d('F', 'Y')
- L = 1
- R = len(s)
- while L + 1 < R:
- M = (L + R) // 2
- if 'X' * M in s:
- L = M
- else:
- R = M
- print(L)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement