You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': s = input() counts = {} for i in s: counts[i] = s.count(i) counts = sorted(counts.items(), key=lambda x: (-x[1], x[0])) for i in range(3): print(counts[i][0], counts[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 →