In this leetcode problem, we are asked to calculate the minimum amounts of “deletions” to remove the max and the min from an array.
You are given a 0-indexed array of distinct integers
There is an element in
numsthat has the lowest value and an element that has the highest value. We call them the minimum and maximum respectively. Your goal is to remove both these elements from the array.
A deletion is defined as either removing an element from the front of the array or removing…