You are viewing a single comment's thread. Return to all comments →
from collections import Counter if __name__ == '__main__': s = input() d = (sorted(Counter(s).items(), key=lambda item: (-item[1], item[0]))[:3]) for item in d: print(item[0], item[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 →