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

Qui apparirà il risultato dell'esecuzione del codice

Tests12
Visible tests
Test nascosto 7
Test nascosto 8
Test nascosto 9
Test nascosto 10
Test nascosto 11
Test nascosto 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