Count Words
Верните количество слов в строке s (слова разделены пробелами).
Примеры
Ввод
"hello world"Вывод
2Ввод
" one two three "Вывод
3Ввод
""Вывод
0Нужно реализовать
def count_words(s: str) -> int:
Теги
strings
Inicia sesión para ver tu historial de envíos
Iniciar sesiónInicia sesión para usar el AI Mentor
Iniciar sesiónVisible tests
1
Input
"hello world"Expected
22
Input
" one two three "Expected
33
Input
""Expected
0Focus radio
Paused · SomaFM · Fluid