Colm wise web Print(all test cases shows error but code)

package TwoDArrays;

import java.util.Scanner;

public class WavePrintColmnWise {

public static void main(String[] args) {
	//int[][] arr=takeInput();
//	int[][] array= {{11,12,13,14},{21,22,23,24},{31,32,33,34},{41,42,43,44}};
	
	


	Scanner s=new Scanner(System.in);
	System.out.println("Enter the no of rows ");
	int rows=s.nextInt();
	int arr[][]= new int [rows][];
	for(int row=0;row<rows;row++)
	{
		
		int cols=s.nextInt()

;
arr[row]=new int[cols];
for(int col=0;col<cols;col++){

			arr[row][col]=s.nextInt();
			
		}
		}
	
	
		for(int j=0;j<arr.length;j++)
		{
				if(j%2==0)
					
				{
					for(int i=0;i<arr.length;i++)
					{
						System.out.print(arr[i][j]+" ");
					}
					
				}
				else
				{
					for(int i=arr.length-1;i>=0;i--)
					{
						System.out.print(arr[i][j]+" ");
					}
					
					
				}
			
		}
		System.out.print("End");
		
		}

}

Which problem is this?
You have marked it in double sided arrow

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.