Python3 ||  pairwise  || T/S: 99% / 68%
https://leetcode.com/problems/minimum-pair-removal-to-sort-array-i/submissions/1598821138/I could be wrong, but I think that time complexity is O(N ^2) and spac
``` Python3 []
class Solution:
    def minimumPairRemoval(self, nums: List[int], ans = 0) -> int:

        def notSorted(nums: List[int]) -> bool:
            for a, b in pairwise(nums):
                if a > b: return True
            return False

        
        while notSorted(nums):
            minSum, mnIdx = inf, -1
            
            for i, pair in enumerate(pairwise(nums)):
                if sum(pair) < minSum:
                    minSum, mnIdx, delIdx = sum(pair), i, i+1
            
            nums[mnIdx] = minSum
            del nums[delIdx]
            ans+= 1
            
        return ans 
```
[https://leetcode.com/problems/minimum-pair-removal-to-sort-array-i/submissions/1598821138/](https://leetcode.com/problems/minimum-pair-removal-to-sort-array-i/submissions/1598821138/)



I could be wrong, but I think that time complexity is *O*(*N* ^2) and space complexity is *O*(1), in which *N* ~ `len(nums)`.
['Python3']