Untitled

mail@pastecode.io avatar
unknown
python
a year ago
216 B
2
Indexable
Never
f = open('24.3.txt')
s = f.readline().split("G")
cnt = 0
res = []
x = 'G'
for i in range(len(s)):
    x += s[i] + 'G'
    if s[i].count("I") <= 4:
        res.append( len(x))
    else:
        x = "G"
print(max(res))