Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s=''
- with open('24.txt') as f:
- s = f.readline()
- s = s.replace('S', 'Q')
- s = s.replace('R', 'Q')
- s = s[:-1]
- s += 'QQa'
- #print(s)
- kmax = 0
- k=0
- i=0
- #for i in range(len(s)):
- #print(i, s[i], end=' ')
- #print()
- i=0
- while i + 1 < len(s):
- if s[i] + s[i + 1] == 'QQ':
- #print("i = ", i)
- k += 1
- kmax = max(k, kmax)
- i += 1
- k = 0
- continue
- k += 1
- i += 1
- print()
- print("kmax")
- print(kmax)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement