This commit is contained in:
Victor Alexandrovich Tsyrenschikov
2025-11-21 00:23:03 +05:00
parent 675fa882e0
commit 49dcd3a8ed

18
24.7.py
View File

@@ -15,20 +15,4 @@
# matches = re.findall(pattern, data) # matches = re.findall(pattern, data)
# #
# res = max([len(match[0] + match[1]) # res = max([len(match[0] + match[1])
# for match in matches]) # for match in matches])
# print(res)
from itertools import count
f = open('24_7.txt').read()
a=[]
j=0
count = 0
for i in range(len(f)-1):
if f[i]+f[i+1]=='CD':
count+=1
if count>160:
count=1
a.append(i+1-j)
j=i
print(max(a))