Greedily merge the adjacent pair with the smallest sum until the array becomes non-decreasing   
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
```java []
import java.util.*;

class Solution {
    public int minimumPairRemoval(int[] nums) {
        LinkedList<Integer> list = new LinkedList<>();
        for (int num : nums) list.add(num);

        int operations = 0;

        while (!isSorted(list)) {
            int minSum = Integer.MAX_VALUE;
            int index = -1;

            for (int i = 0; i < list.size() - 1; i++) {
                int sum = list.get(i) + list.get(i + 1);
                if (sum < minSum) {
                    minSum = sum;
                    index = i;
                }
            }

            list.remove(index);
            list.remove(index);
            list.add(index, minSum);
            operations++;
        }

        return operations;
    }

    private boolean isSorted(List<Integer> list) {
        for (int i = 1; i < list.size(); i++) {
            if (list.get(i) < list.get(i - 1)) return false;
        }
        return true;
    }
}

```
['Java']