cpp ❤️ easy solution 🌸
Code
# Code
```cpp []
class Solution {
public:
    void checkforSortedArray(vector<int>& nums, bool& flag) {
        for (int i = 0; i < nums.size() - 1; i++) {
            // not sorted
            if (nums[i] > nums[i + 1]) {
                flag = 1;
                break;
            }
        }
    }
    int minimumPairRemoval(vector<int>& nums) {
        bool flag = 0;
        checkforSortedArray(nums, flag);

        if (!flag) {
            return 0;
        }

        // Now Sort the array
        int count = 0;
        while (flag) {
            count += 1;

            int mini = INT_MAX, indexi;
            for (int i = 0; i < nums.size() - 1; i++) {
                int sum = nums[i] + nums[i + 1];
                if (mini > sum) {
                    mini = sum;
                    indexi = i;
                }
            }

            nums[indexi] = mini;
            nums.erase(nums.begin() + indexi + 1);

            flag = 0;
            checkforSortedArray(nums, flag);
        }

        return count;
    }
};
```
['Array', 'C++']