First solution in Clear category for The Most Frequent by vlad.bezden
The Most Frequent.
You have a sequence of strings, and you’d like to determine
the most frequently occurring string in the sequence.
Input: a list of strings.
Output: a string.
from collections import Counter
def most_frequent(data: list) -> str:
if __name__ == '__main__':
'a', 'b', 'c',
]) == 'a'
assert most_frequent(['a', 'a', 'bi', 'bi', 'bi']) == 'bi'
Oct. 1, 2018