i am getting nezec error

  1. 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 sc = new Scanner(System.in);
int n=sc.nextInt();
for(int i=0;i<n;i++){
int t=sc.nextInt();
int[] a = new int[t];
for(int j=0;j<t;j++){
a[j]=sc.nextInt();
}
Codechef c= new Codechef();
System.out.println(c.search(a,t));
}
}
public int search(int[] a,int t){
Arrays.sort(a);
for(int i=0;i<t;i++){
for(int j=0;j<t-i-1;j++){
if(a[j]==a[j+1]){
return a[j]-a[j+1];
}
}
}
return a[1]-a[0];
}
}