Alice and Bob play a game with piles of stones. There are an **even** number of piles arranged in a row, and each pile has a **positive** integer number of stones `piles[i]`. The objective of the game is to end with the most stones. The **total** number of stones across all the piles is **odd**, so there are no ties. Alice and Bob take turns, with **Alice starting first**. Each turn, a player takes the entire pile of stones either from the **beginning** or from the **end** of the row. This continues until there are no more piles left, at which point the person with the **most** stones **wins**. Assuming Alice and Bob play **optimally**, return `true` if Alice wins the game, or `false` if Bob wins.
Example 1
Input: piles = [5,3,4,5]
Output: true
Explanation: Alice takes the first 5, leaving [3,4,5]. If Bob takes 3, Alice takes the last 5 (10 vs 7). If Bob takes the last 5, Alice takes 4 (9 vs 8). Either way Alice wins.
Example 2
Input: piles = [3,7,2,3]
Output: true
Explanation: Alice takes the last 3, leaving [3,7,2]. Whichever end Bob takes, the 7 becomes available to Alice, so she ends with at least 3 + 7 = 10 of the 15 stones.
Example 3
Input: piles = [1,2]
Output: true
Explanation: Alice takes the larger pile, 2, and Bob is left with 1.
Track the best score DIFFERENCE (current player minus opponent) achievable on each sub-row piles[i..j]. Taking an end scores that pile and hands the rest to the opponent, whose advantage counts against you. Fill sub-rows from short to long; Alice wins iff dp[0][n-1] > 0.
Run checks all cases above. Submit evaluates all test cases.