Naive and intuitive simulation 
IntuitionWe'll simulate the process by running a loop in which we check nums against whether it's sorted and perform the pairwise check as stated.ApproachWe'll
# Intuition

We'll simulate the process by running a loop in which we check `nums` against whether it's sorted and perform the pairwise check as stated.

# Approach

We'll run an outer loop that we'll break as soon as our input is sorted (we'll use variable `xs` that we'll use as the ne new list in the next iteration):
```py
ops = 0
xs = nums
while True:
    mv = math.inf
    j = -1
    if (all(xs[k] <= xs[k + 1] for k in range(len(xs) - 1))):
        break
    for i in range(len(xs) - 1):
        if mv > (xs[i] + xs[i + 1]):
            j = i
            mv = xs[i] + xs[i + 1]
    xs = xs[:j] + xs[j + 1:]
    xs[j] = mv
    ops = ops + 1

return ops
```

The inner for-loop finds the leftmost index `j` that gives us the min-pair and we concatenate the new list for the next iteration and assign it to `xs`:
```py
xs = xs[:j] + xs[j + 1:]
xs[j] = mv
```

We'll use `ops` to count the necessary operations. 


# Complexity
- Time complexity: $$O(n!)$$

- Space complexity: $$O(n)$$

# Code
```python3 []
class Solution:
    def minimumPairRemoval(self, nums: List[int]) -> int:
        ops = 0
        xs = nums
        while True:
            mv = math.inf
            j = -1
            if (all(xs[k] <= xs[k + 1] for k in range(len(xs) - 1))):
                break
            for i in range(len(xs) - 1):
                if mv > (xs[i] + xs[i + 1]):
                    j = i
                    mv = xs[i] + xs[i + 1]
            xs = xs[:j] + xs[j + 1:]
            xs[j] = mv
            ops = ops + 1

        return ops

```
['Array', 'Sorting', 'Python3']