#K52167. Shortest Word Finder
Shortest Word Finder
Shortest Word Finder
Given a sentence, determine the shortest word according to the following rules:
- Ignore all punctuation marks.
- Words are compared in a case-insensitive manner.
- If multiple words share the same shortest length, return the first occurrence.
- If the input is empty or contains no valid word, output an empty string.
Note: To count the length of a word, use the standard formula:
$$ \text{Length}(w) = \sum_{i=1}^{n} 1 $$inputFormat
The input consists of a single line containing a sentence.
outputFormat
Output the shortest word from the sentence.
## sampleThe quick, brown fox jumps over the lazy dog.
the