Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Pick letters, sort, counter most common solution in Clear category for The Most Wanted Letter by Striga
from collections import Counter
def checkio(text: str) -> str:
letters = sorted(i for i in text.lower() if i.isalpha())
mc = Counter(letters).most_common(1)[0]
return mc[0]
if __name__ == '__main__':
assert checkio("Hello World!") == "l", "Hello test"
assert checkio("How do you do?") == "o", "O is most wanted"
assert checkio("One") == "e", "All letter only once."
assert checkio("Oops!") == "o", "Don't forget about lower case."
assert checkio("AAaooo!!!!") == "a", "Only letters."
assert checkio("abe") == "a", "The First."
assert checkio("a" * 9000 + "b" * 1000) == "a", "Long."
Nov. 14, 2020
Comments: