Track Min Pair Sum And if It's InOrder
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
```csharp []
public class Solution {
    public int MinimumPairRemoval(int[] nums) {
        int len = nums.Length, opt = 0;
        if(len < 2)
            return 0;

        List<int> sample = nums.ToList();
        bool inOrder = false;

        while(true)
        {
            int[] preCheck = [int.MaxValue, -1];
            int sum = sample[0];
            bool checkValid = true;
            for(int i = 1; i < sample.Count; i++)
            {
                if(sample[i] < sample[i-1])
                    checkValid = false;

                sum += sample[i];

                if(i >= 2)
                    sum -= sample[i-2];

                if(preCheck[0] > sum)
                    preCheck = [sum, i-1];
            }

            if(checkValid)
                return opt;

            sample[preCheck[1]] = preCheck[0];
            sample.RemoveAt(preCheck[1]+1);
            opt++;
        }

        return opt;
    }
}
```
['C#']