This was the least complex code I could create in Java.
Please tell where can the complexity be reduced?
Thanks in advance!
Code :
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
{
// your code goes here
Scanner in = new Scanner(System.in);
int a = in.nextInt();
for( int j=0; j<a ; j++){
int b = in.nextInt();
int sum =0;
for (int i =0; i<b ; i++)
{int h = in.nextInt();
sum += h ;
}
System.out.println(sum);
}
}
}