Two players take turns picking numbers from either end of an array. Each player adds the picked number to their score. Both play optimally. Can Player 1 win (or tie)? Example: nums . Player 1 picks , Player 2 picks , Player 1 picks . Scores: vs . Player 1 loses.
But if Player 1 picks first, then ... try it yourself. This is the classic Game Theory DP problem. The array shrinks from both ends, and we need to track who's winning at each subarray.