Alice and Bob play a game with piles of stones arranged in a row.
There is an even number of piles, where piles[i] represents the number of stones in the
Alice and Bob take turns, with Alice making the first move. On each turn, a player takes all the stones from either the beginning or the end of the current row of piles. This continues until no piles remain. The player with the higher total number of stones wins.
Assuming both players play optimally, return true if Alice wins the game, or false otherwise.
Constraints:
piles.length
piles.length is even.
piles[i]
sum(piles[i]) is odd.
Alice and Bob play a game with piles of stones arranged in a row.
There is an even number of piles, where piles[i] represents the number of stones in the
Alice and Bob take turns, with Alice making the first move. On each turn, a player takes all the stones from either the beginning or the end of the current row of piles. This continues until no piles remain. The player with the higher total number of stones wins.
Assuming both players play optimally, return true if Alice wins the game, or false otherwise.
Constraints:
piles.length
piles.length is even.
piles[i]
sum(piles[i]) is odd.