Game of Maximization

Two players play a game with an array of integers arranged in a line. On each turn, a player picks one integer from either the left end or the right end of the remaining array. Both players play optimally to maximize their own total sum. Return the maximum sum the first player can achieve. This repository entry is game-of-maximization; do not infer rules from other same-title or pick-from-ends problems.

Examples
Input: [5,3,7,10]
Output: 15
Hints

Game of Maximization

Two players play a game with an array of integers arranged in a line. On each turn, a player picks one integer from either the left end or the right end of the remaining array. Both players play optimally to maximize their own total sum. Return the maximum sum the first player can achieve. This repository entry is `game-of-maximization`; do not infer rules from other same-title or pick-from-ends problems.