Java with O(n^2) Complexity.
IntuitionIn each iteration find the minimum pair and replace with its sum until array is in increasing order.Approach
Convert array to List.
Check if it is in i
# Intuition
In each iteration find the minimum pair and replace with its sum until array is in increasing order.

# Approach
<!-- Describe your approach to solving the problem. -->
1. Convert array to List.
2. Check if it is in increasing order, then return zero.
3. Until the list become in increasing order, find the pair with minimum sum and replace it with its sum.

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
$$O(n^2)$$ 
Finding/replacing the pair then check if it is in increasing order.

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
$$O(n)$$ 
Store the array in the List

# Code
```java []
class Solution {
    public int minimumPairRemoval(int[] nums) {
        List<Integer> list = Arrays.stream(nums).boxed().collect(Collectors.toList());
        var count = 0 ;
        if(isNonDecreasing(list)) return count;
        var pivot = 0;
        var min = 0;
        do{
            min = Integer.MAX_VALUE;
            count++;
            for(var i=0; i< list.size() - 1; i++){
                var temp = list.get(i) + list.get(i+1);
                if(temp < min){
                    min = temp;
                    pivot = i;
                }
            }
            list.set(pivot, min);
            list.remove(pivot+1);
        }while(!isNonDecreasing(list));
        return count;
    }

    boolean isNonDecreasing(List<Integer> list){
        for(var i=0; i< list.size() - 1; i++){
            if(list.get(i) > list.get(i+1)) return false;
        }
        return true;
    }
}
```
['Java']