BEST APPROCAH TO SOLVE THE PROBLEM | | EASY TO UNDERSTAND | | BEATS 100% 
IntuitionApproachComplexity
Time complexity:
FOR THIS PROBLEM THE EFFICIENT WAY IS O(n^2)
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)$$ -->
FOR THIS PROBLEM THE EFFICIENT WAY IS O(n^2)
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int minimumPairRemoval(vector<int>& nums) {
        bool check1=is_sorted(nums.begin(),nums.end());
        if(check1) return 0;
        int operation=0;
        while(!is_sorted(nums.begin(),nums.end())){
            int k=0;
            int minsum=INT_MAX; 
            for(int i=1;i<nums.size();i++){
                int sum=nums[i]+nums[i-1];
                if(minsum>sum){
                    minsum=sum;
                    k=i;
                }
            }
            nums[k-1]=nums[k-1]+nums[k];
            nums.erase(nums.begin()+k);
            operation++;
        }
        return operation;
    }
};
```
['C++']