Farz0l1x

Untitled

Mar 26th, 2023
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. s= 'aaaarytartugaasstsyssss'
  2. d = dict()
  3. Max = 0
  4. for c in s:
  5.     if c in d:
  6.         d[c] += 1
  7.         Max = max(Max, d[c])
  8.     else:
  9.         d[c] = 1
  10. a = []
  11. for c in d:
  12.     if d[c] == Max:
  13.         a.append(c)
  14. a.sort()
  15. print(a[0])
Advertisement
Add Comment
Please, Sign In to add comment