Prasad'sCODE
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
```python []
class Solution(object):
    def minimumPairRemoval(self, nums):
        def is_non_decreasing(arr):
            return all(arr[i] <= arr[i + 1] for i in range(len(arr) - 1))

        operations = 0

        while not is_non_decreasing(nums):
            min_sum = float('inf')
            min_index = -1
            for i in range(len(nums) - 1):
                pair_sum = nums[i] + nums[i + 1]
                if pair_sum < min_sum:
                    min_sum = pair_sum
                    min_index = i
            # Replace the pair with their sum
            merged = nums[min_index] + nums[min_index + 1]
            nums = nums[:min_index] + [merged] + nums[min_index + 2:]
            operations += 1

        return operations

        
```
['Python']