Python || Beat 100% || Two Pointers solution
IntuitionApproachComplexity
Time complexity: O(n log n) on average, O(n²) in the worst case.

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 log n) on average, O(n²) in the worst case.
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

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

# Code
```python []
class Solution(object):

    def findMinValueIndex(self, nums, lt, rt):
        minValue = float('inf')
        for i in range(lt, rt):
            if nums[i] + nums[i+1] < minValue:
                minValue = nums[i] + nums[i+1]
                minIndex = i
        return minIndex
    
    def isIncreasing(self, nums, lt, rt):
        return all([nums[i] <= nums[i+1] for i in range(lt,rt)])

    def minimumPairRemoval(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        
        ans = 0
        lt, rt = 0, len(nums) - 1
        while lt < rt:
            minIndex = self.findMinValueIndex(nums,lt,rt)
            if minIndex == lt and self.isIncreasing(nums,lt,rt):                
                lt += 1

            else:
                nums[minIndex] += nums[minIndex+1]
                while minIndex<rt - 1:
                    minIndex += 1
                    nums[minIndex] = nums[minIndex+1]
                rt - =1
                ans + =1

        return ans
```
['Array', 'Two Pointers', 'Python']