Tap here to switch tabs
Problem
Submissions

Problem: Final Element After Subarray Deletions

Try to solve the Final Element After Subarray Deletions problem.

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

Try to solve the Final Element After Subarray Deletions problem.

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