Python Solution
IntuitionNothing :)ApproachSimple brute force approach. Check using while loop that if the array is sorted or not. If not take the set of minimum sum value, rep
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Nothing :)
# Approach
<!-- Describe your approach to solving the problem. -->
Simple brute force approach. Check using while loop that if the array is sorted or not. If not take the set of minimum sum value, replace by those two indexes and increase the count by 1. Finally return the count.
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(N³)
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
O(N)
# Code
```python3 []
class Solution:
    def minimumPairRemoval(self, nums: List[int]) -> int:
        if len(nums) <= 1:
            return 0
        c = 0
        while nums != sorted(nums):
            msum, mid = float('inf'), 0
            for i in range(len(nums) - 1):
                if msum > nums[i] + nums[i + 1]:
                    msum = nums[i] + nums[i + 1]
                    mid = i
            nums = nums[:mid] + [msum] + nums[mid + 2:]
            c += 1
        return c
```
['Python3']