Leetcode 1371. Find the Longest Substring Containing Vowels in Even Counts
Find the length of the longest substring where each vowel (a, e, i, o, u) occurs an even number of times. This is typically solved in O(n) by tracking the parity of the five vowels with a bitmask and remembering the earliest index each parity-state appeared to compute maximal substring lengths.
Asked at:
Meta
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early June, 2026
Meta
Mid-level
Early June, 2026
Amazon
Mid-level
same question
Hello Interview Premium
Your account is free and you can post anonymously if you choose.