Arrays-wave print row challenges

output is right but still my code does not pass any test cases
package challengesArrays;
import java.util.Scanner;
public class WAve {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	Scanner sc = new Scanner(System.in);

	int n = sc.nextInt();
	int m = sc.nextInt();
	if(n>1 && n<10 && m>1 && m<10)
	{
	int[][] arr = new int[n][m];
	for(int i =0 ; i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			arr[i][j] = sc.nextInt();
		}
	}
	waves(arr);
	}
	
}


public static void waves(int[][] arr)
{
	for(int i=0; i<arr.length;i++)
	{
		if(i%2==0)
		{
			for(int j=0 ; j<arr[i].length;j++)
			{
				System.out.print(arr[i][j]+",");
			}
		}
		else
		{
			for(int j = arr[i].length-1;j>=0;j--)
			{
				System.out.print(arr[i][j]+",");
			}
		}
	}
	System.out.print("END");
}

}

@mayanktiwari6957,
I see that you have got the correct answer. Do you have any further doubts related to the question?

i know my answer is correct… but it does not pass any test case

@mayanktiwari6957,

But your submissions show that you have got 100 points for the question

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.