Longest stretch with even vowel counts
Given a string s of lowercase English letters, return the length of the longest substring in which each of the five vowels a, e, i, o and u appears an even number of times. Zero is even, so a stretch with no vowels at all counts. Return 0 when no non-empty substring qualifies (or s is empty).
Aim for one pass over s.
Besides the tests, one large input (a 4,831-letter string) with a ~100 ms limit (scaled to your device's speed): brute force won't pass.
Examples
longest_even_vowels("teatimecookie")→10longest_even_vowels("rhythm")→6longest_even_vowels("aeiou")→0