Count Camel Words
In camelCase, several words are written together: the first starts with a lowercase letter, and each next word starts with an uppercase letter. The function camelcase receives a string s in this format. Count the words in the string: the first word is already present, and every uppercase letter starts a new one. Return that count.
Примеры
Ввод
"saveChangesInTheEditor"Вывод
5Ввод
"oneWord"Вывод
2Ввод
"word"Вывод
1Нужно реализовать
def camelcase(s: str) -> int:
Теги
strings
Logi sisse, et näha esituste ajalugu
Logi sisseLogi sisse, et kasutada AI mentorit
Logi sisseVisible tests
1
Input
"saveChangesInTheEditor"Expected
52
Input
"oneWord"Expected
23
Input
"word"Expected
14
Input
"aBcDeF"Expected
45
Input
""Expected
06
Input
"word!"Expected
1Focus radio
Paused · SomaFM · Fluid