Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('24.txt') as f:
- a = f.read()
- cnt = float('-inf')
- b = 0
- for i in range(1, len(a)-1):
- if a[i] != a[i-1] and a[i] != a[i+1]:
- b += 1
- if cnt < b:
- cnt = b
- else:
- b = 0
- print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment