Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = open('15.txt')
- text = file.readline()
- d = dict()
- Max = 0
- for c in text:
- if c in d:
- d[c] += 1
- Max = max(Max, d[c])
- else:
- d[c] = 1
- ans = []
- for c in d:
- if d[c] == Max:
- ans.append(c)
- ans.sort()
- print(ans[0], text.count('W'))
Advertisement
Add Comment
Please, Sign In to add comment