BEST AND SIMPLE SOLUTION 
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
```cpp []
class Solution {
public:
    int minimumPairRemoval(vector<int>& nums) { 
       
        int n = nums.size(); 
        
        bool nondec = false;
        int ans = 0;
                
        while(!nondec) {
            
            for(int i=1; i<nums.size(); i++) {
               if(nums[i] < nums[i-1]) {
                   break;
               }    
               if(i == nums.size()-1) nondec = true; 
            }
         
            if(nums.size() == 1 || nondec == true) break;
         
            int idx = -1;
            int sum = INT_MAX;
            
            for(int i=1; i<nums.size(); i++) {
                if(nums[i]+nums[i-1] < sum) {
                    sum = nums[i] + nums[i-1];
                    idx = i-1;
                }
            }
            
            if(idx != -1 && sum != INT_MAX) {
                nums.erase(nums.begin()+idx+1);
                nums[idx] = sum;
            }   
            
            ans++;
        }
        
        return ans;
    }
};
```
['C++']