Find the Longest Substring Having Vowels in Even Counts

Try to solve the Find the Longest Substring Containing Vowels in Even Counts problem.

Statement

Given the string s, return the length of the longest substringA substring is a consecutive sequence of characters within a string. in which each vowel—a, e, i, o, and u—appears an even number of times.

Constraints:

  • 1≤1 \leq s.length ≤5×103\leq 5 \times 10^3

  • s contains only lowercase English letters.

Examples

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.