Shortest Word Length

In text analysis, it is often useful to quickly find the shortest word, for example when checking phrases or collecting simple stats. Write find_short, which takes a non-empty string s containing words separated by spaces. Return the length of the shortest word.

Примеры

Ввод
"bitcoin take over the world maybe who knows perhaps"
Вывод
3
Ввод
"turns out random test cases are easier than writing out basic ones"
Вывод
3
Ввод
"lets talk about javascript the best language"
Вывод
3

Нужно реализовать

def find_short(s: str) -> int:

Теги

strings
PostgreSQLv16

Tu sa zobrazí výsledok spustenia kódu

Visible tests
1
Input
"bitcoin take over the world maybe who knows perhaps"
Expected3
2
Input
"turns out random test cases are easier than writing out basic ones"
Expected3
3
Input
"lets talk about javascript the best language"
Expected3
4
Input
"i want to travel the world writing code one day"
Expected1
5
Input
"Lorem ipsum dolor sit amet"
Expected3
6
Input
"a"
Expected1
Focus radio
Paused · SomaFM · Fluid