Farz0l1x

Untitled

Apr 16th, 2023
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. file = open('16.txt')
  2. text = file.readline()
  3. text = text.strip()
  4. d = dict()
  5. Max = 0
  6. Min = 10000000000000
  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. for elem in d:
  14.     Min = min(Min, d[elem])
  15. print(Max - Min)
Advertisement
Add Comment
Please, Sign In to add comment