Candy Race with Different Types
You are given a list of integers candies
and are playing a game against a friend. In each round, a person can remove any two consecutive candies with the same value. Given that whoever can’t pick up a candy loses and that you start first, return whether you will win.
Constraints
n ≤ 100,000
wheren
is the length ofcandies
https://binarysearch.com/problems/Candy-Race-with-Different-Types
Examples
Example 1
Input
- nums =
[4, 4, 3]
Output
- answer =
True
Explanation
If you pick the 4
s the other person can’t pick any candies.
Leave a comment