You are viewing a single comment's thread. Return to all comments →
from collections import Counter if __name__ == '__main__': a = [b for b in input()] s = Counter(a) s = [(i, j) for i, j in s.items()] s = sorted(s, key=lambda x: (-x[1], x[0])) for i in s[:3]: print(f"{i[0]} {i[1]}")
Seems like cookies are disabled on this browser, please enable them to open this website
Company Logo
You are viewing a single comment's thread. Return to all comments →