Vowels Game in a String - Practice Coding | SlaveCode
0
0123456789
0
0123456789
:
0
0123456789
0
0123456789
3227. Vowels Game in a String
Medium
30 Points
Math
String
Brainteaser
Game Theory
Alice and Bob are playing a game on a string.
You are given a string s, Alice and Bob will take turns playing the following game where Alice starts first:
The first player who cannot make a move on their turn loses the game. We assume that both Alice and Bob play optimally.
Return true if Alice wins the game, and false otherwise.
The English vowels are: a, e, i, o, and u.
Examples
Example 1
Input: s = "leetcoder"
Output: true
Explanation: Alice can win the game as follows:
Example 2
Input: s = "bbcd"
Output: false
Explanation: There is no valid play for Alice in her first turn, so Alice loses the game.
Constraints
1 <= s.length <= 105
s consists only of lowercase English letters.
3227. Vowels Game in a String
Medium
30 Points
Math
String
Brainteaser
Game Theory
Alice and Bob are playing a game on a string.
You are given a string s, Alice and Bob will take turns playing the following game where Alice starts first:
The first player who cannot make a move on their turn loses the game. We assume that both Alice and Bob play optimally.
Return true if Alice wins the game, and false otherwise.
The English vowels are: a, e, i, o, and u.
Examples
Example 1
Input: s = "leetcoder"
Output: true
Explanation: Alice can win the game as follows:
Example 2
Input: s = "bbcd"
Output: false
Explanation: There is no valid play for Alice in her first turn, so Alice loses the game.