Alice and Bob play a game using an array of integers stones arranged in a line from left to right.
Alice plays first. On each turn, the active player chooses an integer
The game concludes when only
Alice seeks to maximize the difference between her score and Bob’s score, whereas Bob seeks to minimize this difference.
Assuming both players play optimally, return the resulting score difference between Alice and Bob.
Constraints:
n stones.length
n
stones[i]
Alice and Bob play a game using an array of integers stones arranged in a line from left to right.
Alice plays first. On each turn, the active player chooses an integer
The game concludes when only
Alice seeks to maximize the difference between her score and Bob’s score, whereas Bob seeks to minimize this difference.
Assuming both players play optimally, return the resulting score difference between Alice and Bob.
Constraints:
n stones.length
n
stones[i]