Most Common Word Length
sentence holds lowercase words separated by single spaces. Return the word length that occurs most often among its words.
If several lengths occur equally often, return the smallest of them. The empty sentence has no words and gives 0.
Example 1
sentence "the quick brown fox jumps"
returns 5
Lengths are 3, 5, 5, 3, 5: three words of length 5 and two of length 3.
Example 2
sentence "a bb cc d"
returns 1
Lengths 1 and 2 each occur twice; the smaller length wins.
Constraints
0 <= len(sentence) <= 60- lowercase letters and single spaces only, with no space at either end
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.