0ms - simple approach
IntuitionApproachComplexity
Time complexity: O(n^2)

Space complexity: O(1)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(n^2)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```javascript []
/**
 * @param {number[]} nums
 * @return {number}
 */
var minimumPairRemoval = function (nums) {
    function isNonDecreasingArray(nums) {
        for (let i = 0; i < nums.length - 1; i++) {
            if (nums[i] > nums[i + 1]) return false
        }
        return true
    }
    let count = 0;
    while (!isNonDecreasingArray(nums)) {
        let minIndex = 0;
        let minSum = Infinity;
        for (let i = 0; i < nums.length - 1; i++) {
            let pairSum = nums[i] + nums[i + 1];
            if (pairSum < minSum) {
                minSum = pairSum;
                minIndex = i
            }
        }
        // nums[minIndex] = minSum;
        nums.splice(minIndex, 2, minSum);
        count++
    }
    return count

};
```
['Array', 'Simulation', 'JavaScript']