Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=55611
- data = open('24 (1).txt').readlines()
- CNT = {}
- for e in data:
- cnt = {}
- for i in range(1, len(e)):
- if e[i - 1] == 'A':
- if e[i] not in cnt:
- cnt[e[i]] = 0
- cnt[e[i]] += 1
- mx = max(cnt.values())
- for c in cnt:
- if cnt[c] == mx:
- if c not in CNT:
- CNT[c] = 0
- CNT[c] += 1
- print(max(CNT.values()))
Advertisement
Add Comment
Please, Sign In to add comment