mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-12-01 07:13:44 +03:00
22 lines
419 B
Python
22 lines
419 B
Python
|
with open("24.txt") as f:
|
||
|
data = f.read()
|
||
|
|
||
|
k = 0
|
||
|
m = 0
|
||
|
f = False
|
||
|
for j in range(3):
|
||
|
for i in range(j, len(data), 3):
|
||
|
w = data[i - 3 : i]
|
||
|
if w in ["CFE", "FCE"]:
|
||
|
if f:
|
||
|
k += 1
|
||
|
else:
|
||
|
f = True
|
||
|
k = 1
|
||
|
else:
|
||
|
f = False
|
||
|
if k > m:
|
||
|
m = k
|
||
|
k = 0
|
||
|
print(m)
|