Count Words
Верните количество слов в строке s (слова разделены пробелами).
Примеры
Ввод
"hello world"Вывод
2Ввод
" one two three "Вывод
3Ввод
""Вывод
0Нужно реализовать
def count_words(s: str) -> int:
Теги
strings
Pieslēdzies, lai redzētu iesniegumu vēsturi
PieslēgtiesPieslēdzies, lai izmantotu AI mentoru
PieslēgtiesVisible tests
1
Input
"hello world"Expected
22
Input
" one two three "Expected
33
Input
""Expected
0Focus radio
Paused · SomaFM · Fluid