Advertisement
Farz0l1x

Untitled

Mar 27th, 2024
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. file = open('19.txt')
  2. s = file.readline()
  3. l = 0
  4. kt = 0
  5. ans = 0
  6. for r in range(1, len(s)):
  7.     if s[r] == 'T':
  8.         kt += 1
  9.     while kt >= 100:
  10.         if s[l] == 'T':
  11.             kt -= 1
  12.         l += 1
  13.     ans = max(ans, r - l + 1)
  14. print(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement