Tap here to switch tabs
Problem
Submissions

Problem: Final Element After Subarray Deletions

Final Element After Subarray Deletions asks for the last value in an integer array after Alice and Bob alternately remove nonempty prefixes or suffixes. Alice maximizes it, Bob minimizes it.

Statement

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 11 element remains.

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:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Final Element After Subarray Deletions

Final Element After Subarray Deletions asks for the last value in an integer array after Alice and Bob alternately remove nonempty prefixes or suffixes. Alice maximizes it, Bob minimizes it.

Statement

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 11 element remains.

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:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5