Minimum Pair Removal to Sort Array I
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def minimumPairRemoval(self, nums: List[int]) -> int:
        def isAsc(nums):
            return all(nums[i]<=nums[i+1] for i in range(len(nums)-1))
        cnt=0
        while not isAsc(nums):
            min_sum = float('inf')
            min_index = -1
            for i in range(len(nums)-1):
                if nums[i]+nums[i+1]<min_sum:
                    min_sum = nums[i]+nums[i+1]
                    min_index = i
            
            nums = nums[:min_index]+[min_sum]+nums[min_index+2:]
            cnt+=1
        return cnt
        

```
['Array', 'Simulation', 'Python3']