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