Top Scoring Word
You can give each word a score by adding the values of its letters: a is 1, b is 2, and so on up to z as 26. Write high, which calculates the score of each word in the string x and returns the word with the highest score. If several words have the same top score, return the one that appears first.
Примеры
Ввод
"man i need a taxi up to ubud"Вывод
"taxi"Ввод
"what time are we climbing up the volcano"Вывод
"volcano"Ввод
"take me to semynak"Вывод
"semynak"Нужно реализовать
def high(x: str) -> str:
Теги
strings
Prisijunkite, kad matytumėte pateikimų istoriją
PrisijungtiPrisijunkite, kad naudotumėte DI mentorių
PrisijungtiVisible tests
1
Input
"man i need a taxi up to ubud"Expected
"taxi"2
Input
"what time are we climbing up the volcano"Expected
"volcano"3
Input
"take me to semynak"Expected
"semynak"4
Input
"aa b"Expected
"aa"5
Input
"b aa"Expected
"b"6
Input
"ab"Expected
"ab"Focus radio
Paused · SomaFM · Fluid