Free written solutionRemoving Minimum and Maximum From Array (LeetCode 2091): Solution and Explanation
You may only delete the first or last element of an array of distinct integers. Return the fewest deletions that remove both the minimum and the maximum.
Read the intuition, approach, code and complexity →