PYTHON BRUTE FORCE
IntuitionJust do all the operations until the array is non decreasing.Complexity

Time complexity:
doOperation is linear and checking the entire array for non d
# Intuition
Just do all the operations until the array is non decreasing.

# Complexity
- Time complexity:
doOperation is linear and checking the entire array for non decreasing state is linear. This is done up to the size of the array so n^2

- Space complexity:
Linear extra spaced used to recreate the array each step.

# Code
```python3 []
class Solution:
    def minimumPairRemoval(self, nums: List[int]) -> int:

        def doOperation():
            nonlocal nums
            n = len(nums)
            min_pairs = []
            for i in range(n - 1):
                first = nums[i]
                second = nums[i + 1]
                pair_sum = first + second
                triplet = (pair_sum, i, i + 1)
                min_pairs.append(triplet)
            smallest_pair = min(min_pairs)
            new_pair_sum, first, second = smallest_pair
            new_nums = nums[:first] + [new_pair_sum] + nums[second + 1:]
            nums = new_nums
    
        last_good_index = 0
        prev_val = nums[0]
        operation_count = 0

        def isNonDecreasing() -> None:
            nonlocal nums
            n = len(nums)
            for i in range(n - 1):
                first = nums[i]
                second = nums[i + 1]
                if second < first:
                    return False
            return True

        while not isNonDecreasing():
            operation_count += 1
            doOperation()
 
        return operation_count
```
['Python3']