You are given a nums consisting of distinct elements.
In a single operation, you can remove either the first element or the last element of nums.
Return the minimum number of deletions needed to remove both the minimum element and the maximum element from the array.
Constraints:
nums.length
nums[i]
The integers in nums are distinct.
You are given a nums consisting of distinct elements.
In a single operation, you can remove either the first element or the last element of nums.
Return the minimum number of deletions needed to remove both the minimum element and the maximum element from the array.
Constraints:
nums.length
nums[i]
The integers in nums are distinct.