java solution
IntuitionApproachComplexity
Time complexity:O(n^2)

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

# Approach
<!-- Describe your approach to solving the problem. -->

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

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

# Code
```java []
class Solution {
    public int minimumPairRemoval(int[] nums) {
        int operation =0;
        int n=nums.length;
        int operations=0;
        
        while(!isNonDecreasing(nums)){
            int minSum= Integer.MAX_VALUE;
            int minIndex=-1;
            
            for(int i=0;i<nums.length-1;i++){
                int sum=nums[i]+nums[i+1];
                if (sum <minSum){
                    minSum=sum;
                    minIndex=i;
                }
            }
           
            nums[minIndex]=minSum;
            int[]newNums=new int [nums.length-1];
            int j=0;
            for(int i=0;i<nums.length;i++){
                if(i!=minIndex+1){
                    newNums[j++]=nums[i];
                }
            }
            nums=newNums;
            operations++;
        }
        return operations;
        
    }
    private boolean isNonDecreasing(int[] nums){
        int n=nums.length;
        for(int i=0;i<n-1;i++){
            if(nums[i]>nums[i+1]){
                return false;
            }
        }
        return true;
    }
}
```
['Java']