Search
⌘K

Leetcode 2091. Removing Minimum and Maximum From Array

Given an array of distinct integers, find the minimum number of deletions from the front or back needed to remove both the array's minimum and maximum elements. Because deletions only remove ends, the task reduces to choosing the optimal combination of left/right pops based on the positions of the min and max (n up to 1e5).

Asked at:

Amazon

Amazon


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid November, 2024

Amazon

Amazon

Junior

Maximize Warehouse Efficiency: Given an array of parcel weights, calculate the maximum efficiency by repeatedly selecting and removing either the first or last parcel in the array.

Comments

Your account is free and you can post anonymously if you choose.