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
Entre para enviar

O resultado da execução do código aparecerá aqui

Tests12
Visible tests
Teste oculto 7
Teste oculto 8
Teste oculto 9
Teste oculto 10
Teste oculto 11
Teste oculto 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