Free written solutionVowels Game in a String (LeetCode 3227): Solution and Explanation
Alice removes substrings with an odd number of vowels, Bob with an even number. Alice wins exactly when the string contains at least one vowel, so the solution is a single scan for a vowel.
Read the intuition, approach, code and complexity →