my code is running on ide but here it is not working.help me out??

package javaapplication1;
import java.util.*;

class JavaApplication1 {

public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int t=sc.nextInt();
   while(t-->0) {
       int n=sc.nextInt();
       int arr[]=new int[n];
       for(int i=0;i<arr.length;i++)
       {
           arr[i]=sc.nextInt();
           
       }
       Arrays.sort(arr);
       int min=arr[1]-arr[0];
       for(int i=0;i<arr.length-1;i++)
       {
           int c=arr[i+1]-arr[i];
           if(c<=min)
           {
               min=c;
           }
       }
       System.out.println(min);
        
    }
   
}

}

@ldevi929 I think you should not include package statement in your submission.

Please remove the line

package javaapplication1;

from your code and try again. It Will work.