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
PostgreSQLv16

Itt jelenik meg a kód futtatásának eredménye

Tests12
Visible tests
Rejtett teszt 7
Rejtett teszt 8
Rejtett teszt 9
Rejtett teszt 10
Rejtett teszt 11
Rejtett teszt 12

They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.

Focus radio
Paused · SomaFM · Fluid