scripts/ege/28.03.2023 ПРОБНИК/Faily_IN11_28032023_/24.py
2023-05-05 00:45:01 +03:00

19 lines
426 B
Python
Vendored

with open("24.txt") as f:
data = f.read().splitlines()
l = []
for r in data:
res = {}
for i in range(1, len(r)):
r1 = r[i - 1]
r2 = r[i]
if r1 == "T":
if r2 in res:
res[r2] += 1
else:
res[r2] = 1
mx = max(res.values())
l += [x for x in res if res[x] == mx]
print(max([l.count(el) for el in list(set(l))]))