Here i am getting correct output but my testcases are wrong

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
int [][]arr=new int[n][m];
for(int i=0;i<arr.length;i++){
for(int j=0;j<arr.length;j++){
arr[i][j]=sc.nextInt();
}
System.out.println();
}
columnprint(arr);
sc.close();
}
public static void columnprint(int [][]arr){
for(int i=0;i<arr.length;i++){
if(i%2==0){
for(int j=0;j<arr.length;j++){
System.out.print(arr[j][i]+", β€œ);
}
}
else{
for(int j=arr.length-1;j>=0;j–){
System.out.print(arr[j][i]+”, ");
}
}
}
System.out.print(β€œEND”);
}
}

Hello Shubham,
Please let us know whether you are getting every test case failed, or getting some of the test cases failed.
Please give us the detailed test case detail.
After then We will proceed further.
Hope you will respond asap.

all the test cases are failed but the output is correct

shubham please check your output with sample output means what output is required by question i.e space between two numbers and Pattern of output etc. if you still get error please let me know.