Advertisement
nq1s788

24 самая частая после E

Dec 21st, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. #https://inf-ege.sdamgia.ru/problem?id=33494
  2. s = open('24 (1).txt').readline()
  3. cnt = {}
  4. for i in range(1, len(s)):
  5.     if s[i - 1] == 'E':
  6.         if s[i] not in cnt:
  7.             cnt[s[i]] = 0
  8.         cnt[s[i]] += 1
  9. answ = (0, 'q')
  10. for e in cnt:
  11.     answ = max(answ, (cnt[e], e))
  12. print(answ[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement