Find the Longest Substring Containing Vowels in Even Counts
MediumLeetCodeBit Manipulation
Approach hintTry it first, then revealHide
Encode the parity of each vowel count as a 5-bit mask over the prefix. Two prefixes with the same mask bound a valid substring, so store the first index at which each mask appears.