Advertisement
Farz0l1x

Untitled

Mar 27th, 2024
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. file = open('17.txt')
  2. s = file.readline()
  3. f = [0] * len(s)
  4. for i in range(2, len(s)):
  5. if (s[i] == 'A' and s[i-2] == 'A') or (s[i] == 'C' and s[i-2] == 'C'):
  6. f[i] = f[i-2] + 2
  7. print(max(f))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement