getting NZEC error in java

program runs perfectly in pc.

import java.io.;
import java.util.
;
class max
{

public static void main(String[] args)throws  NumberFormatException, IOException{
     int max_count=0,max_index=0;
int count;
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=0;i<T;i++){
    int E=sc.nextInt();
    int array[]=new int[E];
    for(int x=0;x<E;x++)array[x]=sc.nextInt();   //init array
   
    for(int y=0;y<E;y++){
        count=0;
        for(int z=0;z<E;z++)
           {
              if(array[y]==array[z])count++;
    
            }
        if(count>max_count) {
            max_count=count;
            max_index=y;
            
        
        }   
    }
    System.out.println(array[max_index]+ " " +max_count);
}

}
}

Try running some random/exceptional test cases. Or write another program that generates ample test cases and use them to see where you go wrong.

//