My issue
My code
import java.util.*;
class Codechef
{
public static void main (String[] args)
{
Scanner read = new Scanner(System.in);
int t = read.nextInt();
int ele;
for(int i=0; i<t; i++)
{
int n = 10;
ArrayList<Integer> a = new ArrayList<Integer>();
for(int j=0; j<n; j++){
ele = read.nextInt();
a.add(ele);
}
// Update your code below this line to solve the problem
int t1=a.get(0)+a.get(1)+a.get(2)+a.get(3)+a.get(4);
int t2=a.get(5)+a.get(6)+a.get(7)+a.get(8)+a.get(9);
if(t1>t2){
System.out.println(1);
}
else if(t1<t2){
System.out.println(2);
}
else{
System.out.println(0);
}
}
}
}
Learning course: Java for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone