Simple solution
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 []
class Solution {
   
    public int minimumPairRemoval(int[] nums) {

        ArrayList<Integer> li=new ArrayList<>();

        for(int i=0;i<nums.length;i++){
            li.add(nums[i]);
        }
        int sum;//=li.get(0)+li.get(1);
        int min=Integer.MAX_VALUE;
        int index=0;
        int f=1,j=0;
        int count=0;
        
        while(f==1){
            f=0;
            sum=0;min=Integer.MAX_VALUE;
            index=0;
            for(j=0;j<li.size()-1;j++){
                if(li.get(j)>li.get(j+1)){
                    f=1;
                }
                
                sum=li.get(j)+li.get(j+1);

                if(sum<min){

                    min=sum;
                    index=j;
                }
            }

            if(f==0) return count;
            li.set(index,min);
            //System.out.println(min+" "+index+" "+f);
            count++;
            li.remove(index+1);
            //System.out.println(li);

        }
        return count;
    }
}
```
['Java']