2 tests cases giving RTE (Java)

Hi,
Two of my test cases are giving run time error. I’m trying this solution in Java. Please help.

@Anshul-Chauhan-10221922864290257
Your code is fine
Just change your way of taking input
It is failing for the 2 test cases for some reason
Replace your input with this
Scanner scanner = new Scanner( System.in );
int n = scanner.nextInt();
long arr[] = new long[n];
for(int i=0;i<n;i++){
arr[i] = scanner.nextInt();
}

Kindly close the doubt