Longest Vowel Run
A vowel run is a stretch of consecutive characters of s that are all vowels (a e i o u, in either case). Return the length of the longest vowel run in s, or 0 when s has no vowel at all.
Spaces and consonants end a run; y is not a vowel.
Example 1
s "beautiful"
returns 3
The vowel runs are eau (length 3), i and u; the longest has length 3.
Example 2
s "rhythm"
returns 0
y is not a vowel, so there is no vowel run at all.
Constraints
0 <= len(s) <= 60shas letters of either case and spaces only
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Strings problems
- Longest Word in a SentenceBeginner
- Maximum Nesting Depth of ParenthesesBeginner
- Mirror CipherBeginner
- One Segment of OnesBeginner
- Percentage of Letter in StringBeginner
- Prefix of Any Word in a SentenceBeginner
- Remove Vowels from a StringBeginner
- Reverse Each WordBeginner