FunctionRacerProblemsRace

Longest Vowel Run

BeginnerStringsPython, JavaScript, TypeScript, Java, C++

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

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Strings problems