company logo hackerrank solution

Solutions on MaxInterview for company logo hackerrank solution by the best coders in the world

showing results for - "company logo hackerrank solution"
Claudio
27 Jun 2020
1# Company Logo in python - Hacker Rank Solution
2# python 3
3#!/bin/python3
4# Company Logo in python - Hacker Rank Solution START
5import math
6import os
7import random
8import re
9import sys
10import collections
11
12if __name__ == '__main__':
13    s = sorted(input().strip())
14    s_counter = collections.Counter(s).most_common()
15    s_counter = sorted(s_counter, key=lambda x: (x[1] * -1, x[0]))
16    for i in range(0, 3):
17        print(s_counter[i][0], s_counter[i][1])
18# Company Logo in python - Hacker Rank Solution END
19