Farz0l1x

Untitled

Apr 3rd, 2023
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. file = open('17.txt')
  2. text = file.readline()
  3. d = dict
  4. Max = 0
  5. for i in range(len(text) - 2):
  6. if text[i - 2] == text[i]:
  7. for c in text:
  8. if c in d:
  9. d[c] += 1
  10. Max = max(Max, d[c])
  11. else:
  12. d[c] = 1
  13. ans = []
  14. for c in d:
  15. if d[c] == Max:
  16. ans.append(c)
  17. ans.sort()
  18. print(ans[0])
Advertisement
Add Comment
Please, Sign In to add comment