C++ -- Easy To Understand --
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:
    bool checkSorted(vector<int> &temp){
        for(int i=0;i<temp.size()-1;i++){
            if(temp[i] > temp[i+1]) return false;
        }
        return true;
    }
    int minimumPairRemoval(vector<int>& nums) {
        int n = nums.size();
        int ans = 0;
        while(!checkSorted(nums)){
            int minIdx = -1;
            int minSum = INT_MAX;
            int sum = 0;
            for(int i=0;i<n-1;i++){
                sum = nums[i] + nums[i+1];
                if(minSum > sum){
                    minSum = sum;
                    minIdx = i;
                }
            }
            nums[minIdx] += nums[minIdx+1];
            for(int i=minIdx+1;i<n-1;i++){
                nums[i] = nums[i+1];
            }
            nums.pop_back();
            n--;
            ans++;
        }
        return ans;
    }
};
```
['C++']