Sort by
recency
|
1266 Discussions
|
- steven72127+ 0 comments
- ishanstealth18+ 0 comments
- luca_h94+ 0 comments
- singhshrajan+ 0 comments
- from collections import Counter
- if name == 'main':
- s = input()
- s = list(s)
- store = []
- counter = Counter(s)
- sorted_counter = dict(sorted(counter.items()))
- for i in range(3):
- max_key = max(sorted_counter,key=sorted_counter.get)
- store.append([max_key,str(sorted_counter[max_key])])
- sorted_counter.pop(max_key)
- [print(" ".join(i)) for i in store]
- fa88af+ 0 comments
Please Login in order to post a comment