 || ✅Beats 100% && #Day_78th_Of_Daily_Coding✅ ||
JAI SHREE DATNA🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏Code
# JAI SHREE DATNA🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

# Code
```cpp []
class Solution {
public: 
    bool isSorted(const vector<int>& nums) {
        for (int i = 1; i < nums.size(); ++i) {
            if (nums[i] < nums[i - 1]) return false;
        }
        return true;
    } 
    void mergeMinSumPair(vector<int>& nums) {
        int minSum = INT_MAX;
        int idx = -1; 
        for (int i = 0; i < nums.size() - 1; ++i) {
            int sum = nums[i] + nums[i + 1];
            if (sum < minSum) {
                minSum = sum;
                idx = i;
            }
        } 
        nums[idx] = nums[idx] + nums[idx + 1];
        nums.erase(nums.begin() + idx + 1);
    } 
    int minimumPairRemoval(vector<int>& nums) {
        int operations = 0; 
        while (!isSorted(nums)) {
            mergeMinSumPair(nums);
            operations++;
        } 
        return operations;
    }
};

```
['C++', 'Java', 'Python3']