#C12676. Length of the Shortest Word

    ID: 42129 Type: Default 1000ms 256MiB

Length of the Shortest Word

Length of the Shortest Word

Given a sentence as input, determine the length of the shortest word in the sentence. A word is defined as a contiguous sequence of non-space characters. If the input string is empty or contains only spaces, the output should be 0.

Note: Punctuation is considered part of a word.

inputFormat

A single line of text representing the sentence. The sentence may contain multiple spaces, leading or trailing spaces, or even be empty.

outputFormat

An integer printed on a new line that represents the length of the shortest word in the sentence.## sample

The quick brown fox jumps over the lazy dog
3