Stone Game VI

Alice and Bob take turns picking stones from a collection, with Alice going first.

Each stone i has two values: aliceValues[i] (how much Alice values it) and bobValues[i] (how much Bob values it). On a player's turn, that player picks one remaining stone. Each player's total score is the sum of how they value the stones they picked.

Assuming both play optimally to maximize their own score, determine the result:

  • Return 1 if Alice's total is greater than Bob's.
  • Return -1 if Bob's total is greater.
  • Return 0 if they are equal.
Examples
Input: [[1,3],[2,1]]
Output: 1
Hints

Stone Game VI

Alice and Bob take turns picking stones from a collection, with Alice going first.