Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
The Most Wanted Letter solution in Uncategorized category for The Most Wanted Letter by Aleksandra_Niewiadomska
def checkio(text: str) -> str:
letter_counts = {}
for letter in text.lower():
if letter == " ":
continue
if letter.isalpha():
letter_counts[letter] = letter_counts.get(letter, 0) + 1
max_frequency = max(letter_counts.values())
return min(letter for letter, count in letter_counts.items() if count == max_frequency)
print("Example:")
print(checkio("Hello World!"))
# These "asserts" are used for self-checking
assert checkio("Hello World!") == "l"
assert checkio("How do you do?") == "o"
assert checkio("One") == "e"
assert checkio("Oops!") == "o"
assert checkio("AAaooo!!!!") == "a"
assert checkio("abe") == "a"
print("The mission is done! Click 'Check Solution' to earn rewards!")
Feb. 1, 2023