#C2166. Length of the Shortest Word
Length of the Shortest Word
Length of the Shortest Word
You are given a string containing several words separated by spaces. Your task is to determine the length of the shortest word in the string.
If the string is empty (i.e. it contains no words), output 0.
Note: Words are sequences of characters separated by whitespace. Multiple consecutive spaces should be treated as a single separator.
Examples:
- Input: "hello" → Output: 5
- Input: "The quick brown fox jumps over the lazy dog" → Output: 3
- Input: "cat bat sat mat" → Output: 3
- Input: "" → Output: 0
- Input: "a ab abc abcd" → Output: 1
Make sure your solution correctly handles multiple spaces between words.
inputFormat
The input consists of a single line containing a string s which may include spaces.
Read the input from standard input (stdin).
outputFormat
Output a single integer which is the length of the shortest word in the given string.
Write the output to standard output (stdout).
## samplehello
5