Help me in solving MAXSCORE7 problem

My issue

public static void main (String[] args) throws java.lang.Exception
{
Scanner s= new Scanner(System.in);
int t=s.nextInt();
for(int j=0;j<t;j++){
int n=s.nextInt();
int[] a=new int[n];
for(int i=0;i<n;i++){
    a[i]=s.nextInt();
}
    int score = 0;
    int operations = a.length / 2;
    int i=0;
   while(operations>0){
       int ad=a[i]-a[i+1];
       if(ad<0)
       score=score-ad;
       else
       score+=ad;
       i=i+2;
       operations--;
   }

System.out.println(score);
}
}

#can anyone tell whats wrong in this code?

My code

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	Scanner s= new Scanner(System.in);
	int t=s.nextInt();
	for(int j=0;j<t;j++){
	int n=s.nextInt();
	int[] a=new int[n];
	for(int i=0;i<n;i++){
	    a[i]=s.nextInt();
	}
        int score = 0;
        int operations = a.length / 2;
        int i=0;
       while(operations>0){
           int ad=a[i]-a[i+1];
           if(ad<0)
           score=score-ad;
           else
           score+=ad;
           i=i+2;
           operations--;
       }

	System.out.println(score);
	}
	}
}

Problem Link: Maximum Score Practice Coding Problem - CodeChef

@shivam272001
logic is u have to print the minimum among 0 and 1 count.

yes I get it why we print min of 0 and 1 but in question we are given that we don’t change the order of araay while we perform the operations given so lets assume we are given input11010100 now if you perform operations given in question on this araay the answer should have been 2 but from min. approch we will get answer =4.

@shivam272001
after deletion the strings gets concatenated.

can you please point out my mistake

@shivam272001
here , see how i have performed the operations ,
Now u will get it
image

thank you