---
# System prepended metadata

title: 2091. Removing Minimum and Maximum From Array
tags: [Leetcode, Medium]

---

# 2091. Removing Minimum and Maximum From Array
###### tags: `Leetcode` `Medium`
Link: https://leetcode.com/problems/removing-minimum-and-maximum-from-array/description/
## Code
```python=
class Solution:
    def minimumDeletions(self, nums: List[int]) -> int:
        i, j, n = nums.index(min(nums)), nums.index(max(nums)), len(nums)
        return min(max(i+1, j+1), max(n-i, n-j), i+1+n-j, j+1+n-i)
```