Concise python code
IntuitionSimply just follow the algorithm described in the problem statement and count the number of steps.It seems unlikely that there is an O(nlogn) solution.
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Simply just follow the algorithm described in the problem statement and count the number of steps.

It seems unlikely that there is an $O(nlogn)$ solution. I will think about this further. Heaps and linked lists seems somewhat helpful, but it doesn't seem to help reach a better complexity class.

# Approach
<!-- Describe your approach to solving the problem. -->
Write a function that checks if the list is sorted. This is pretty standard; just check each pair of adjacent elements is sorted.

Repeat until the array is sorted:
1. Find the minimal tuple `(nums[i] + nums[i+1], i)` for each i up to, but not including `len(nums)-1`.
2. Replace the entry at spot `i` with the sum of the `i` and `i+1` entries.
3. Remove the entry `i+1` for the list.
4. Increment a counter to track the number of operations.

# Complexity
- Time complexity: $O(n^2)$
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
Checking if the array is sorted, finding the pair to replace, and `List.pop(i)` is $O(n)$ and in the worst case you have to perform these steps $O(n)$ times.

- Space complexity: $O(1)$ or $O(n)$
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
I destroy the input array, so if you actually need the original array, you would need to make a copy for use in this function, making it $O(n)$. There is only constant auxiliary space used for other parts, making it $O(1)$ if you don't consider the input array as part of the space complexity.

# Code
```python3 []
class Solution:
    def minimumPairRemoval(self, nums: List[int]) -> int:
        def is_sorted(a):
            return all(a[i] <= a[i+1] for i in range(len(a)-1))
        
        ops = 0
        while not is_sorted(nums):
            s, idx = min((nums[i] + nums[i+1], i) for i in range(len(nums)-1))
            nums[idx] = s
            nums.pop(idx+1)
            ops += 1
        return ops
```
['Python3']