#K76017. Shortest Word Length
Shortest Word Length
Shortest Word Length
Given a string consisting of lowercase English letters and spaces, your task is to determine the length of the shortest word in the string. A word is defined as any maximal sequence of non-space characters. Note that the input will always contain at least one word.
Example:
If the input is "my name is John", the words are "my", "name", "is", "John" and the shortest word is "is" with length 2.
Constraints can be expressed in LaTeX as follows: \(1 \leq |s| \leq 10^4\), where \(|s|\) is the length of the input string.
inputFormat
The input consists of a single line that contains a string s
composed of lowercase English letters and space characters.
outputFormat
Output a single integer representing the length of the shortest word in the provided string.
## samplemy name is John
2