loading...

re: Solving a Job Application Code Challenge VIEW POST

FULL DISCUSSION
 

My solution. In python.

from collections import Counter

with open('test.input') as fd:  # the string is in the "test.input" file
    c = Counter(fd.read())

string = ''.join(sorted(c.keys(), key=lambda x: -1 * c[x]))
print(string[:string.index('_')])

Code of Conduct Report abuse