Don't track two separate scores. Track the difference: = maximum (current player's score opponent's score) for subarray .
Why difference? When I pick, I gain points. Then it's opponent's turn, and their "best difference" becomes my negative. The signs flip automatically. Player 1 wins if : their advantage over the full array is non-negative. Understanding this concept will help you solve more complex problems.