Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Counter or not? (2 solutions) solution in Clear category for Most Wanted Letter by CDG.Axel
# without counter
def most_wanted(text: str):
freq = sorted(((text.lower().count(l), l) for l in set(filter(str.isalpha, text.lower()))))
return [l for c, l in freq if c == freq[-1][0]]
# with Counter
def most_wanted(text: str, cnt=__import__('collections').Counter):
freq = cnt(filter(str.isalpha, text.lower()))
return [l for l in freq if freq[l] == max(freq.values())]
Dec. 14, 2022