Scanner sc= new Scanner(System.in);
int sum1=0,sum2=0;
int n= sc.nextInt();
int a[]= new int[n];
for(int i=0;i<n;i++){
System.out.println();
a[i]= sc.nextInt();
}
for (int i=0;i<n;i++){
int j=1;
while(a[i]!=0){
int ld= a[i]%10;
if (j%2==1) sum1+= ld;
else sum2+= ld;
j++;
}
if(j%2==0){
if(sum1%4==0 || sum2%3==0) System.out.println(“Yes”);
else System.out.println(“No”);
}
else{
if(sum2%4==0 || sum1%3==0) System.out.println(“Yes”);
else System.out.println(“No”);
}
}
The above code is for the odd-even problem in the first challenge when I submitted this code online; it gives that time limit extends.
And when I tried to run in eclipse offline, it is not proceeding after taking input.
please tell me where I went wrong