Python - solved during contest
IntuitionDumb brute forceComplexity
Time complexity: O(N2)

Space complexity: O(1)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Dumb brute force

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

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

# Code
```python []
class Solution(object):
    def minimumPairRemoval(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        ans = 0
        sorted = False
        while not sorted:
            sorted = True
            idx = 0
            min_sum = 100000000
            for i in range(1, len(nums)):
                
                if nums[i-1] > nums[i]:
                    sorted = False
            
                if nums[i-1] + nums[i] < min_sum:
                    idx = i-1
                    min_sum = nums[i-1] + nums[i]


            if not sorted:
                nums[idx] = min_sum
                nums = nums[:idx+1] + nums[idx+2:]
                ans += 1

            
        return ans
                    
                    
```
['Python']