Alice and Bob are playing a game with several piles of stones arranged in a row. An integer array stoneValue represents the values of these piles.
Alice goes first, and the two players take turns. On each player’s turn, that player can take
Both players play optimally to maximize their total scores. The player with the higher total score wins. If both players end with the same score, the game results in a draw.
Determine the winner of the game. Return "Alice" if Alice wins, "Bob" if Bob wins, or "Tie" if the game ends in a draw.
Constraints:
stoneValue.length
stoneValue[i]
Alice and Bob are playing a game with several piles of stones arranged in a row. An integer array stoneValue represents the values of these piles.
Alice goes first, and the two players take turns. On each player’s turn, that player can take
Both players play optimally to maximize their total scores. The player with the higher total score wins. If both players end with the same score, the game results in a draw.
Determine the winner of the game. Return "Alice" if Alice wins, "Bob" if Bob wins, or "Tie" if the game ends in a draw.
Constraints:
stoneValue.length
stoneValue[i]