Farz0l1x

Untitled

Apr 4th, 2023
115
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('19.txt')
  2. texts = file.readlines()
  3. Max = 0
  4. Min = 10000000000000
  5. d = dict()
  6. for text in texts:
  7. Max = max(Max, text.count('Q'))
  8. for c in text:
  9. if c in d:
  10. d[c] += 1
  11. Min = min(Min, d[c])
  12. else:
  13. d[c] = 1
  14. ans = []
  15. for c in d:
  16. if d[c] == Min:
  17. ans.append(c)
  18. ans.sort()
  19. print(Max, Min[-1])
Advertisement
Add Comment
Please, Sign In to add comment