Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s=''
- with open('f.txt') as f:
- s = f.readline()
- ans = 0
- i = 0
- def f(l):
- global i
- while i + 1 < len(s):
- if s[i] + s[i + 1] == 'QQ':
- return l + 1
- i += 1
- l += 1
- if i + 1 == len(s):
- return l
- while i + 1 < len(s):
- if s[i] + s[i + 1] == 'QQ':
- i += 1
- k = f(1)
- ans = max(ans, k)
- i += 1
- print(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement