Alice and Bob play a game with an integer array nums, with Alice taking the first turn.
On each turn, the current player must choose and remove a non empty prefix or suffix of the array such that the remaining array is non empty. The game concludes when exactly
Alice aims to maximize the value of the final element, whereas Bob aims to minimize it. Assuming both players play optimally, return the value of the final remaining element.
Constraints:
nums.length
nums[i]
Alice and Bob play a game with an integer array nums, with Alice taking the first turn.
On each turn, the current player must choose and remove a non empty prefix or suffix of the array such that the remaining array is non empty. The game concludes when exactly
Alice aims to maximize the value of the final element, whereas Bob aims to minimize it. Assuming both players play optimally, return the value of the final remaining element.
Constraints:
nums.length
nums[i]