Not passing all test cases

my code for wave print column wise is passing the sample output but when i submit out the code it’s giving 0 test cases pass

@avnoorsingh488 send me your code i will check it.

#include
using namespace std;
int main(){

int row,col;

cin>>row;

cin>>col;
int arr[row][col];

for(int i=0; i<row; i++)
{
for (int j=0; j<col; j++)
{
cin>>arr[i][j];
}

}

//Print

           for(int j=0;j<col;j++){
           	
        if(j%2==0){
        	for(int i=0;i<row;i++){
			
        	cout<<arr[i][j]<<","; 
		}}
		else {
			for(int i=row-1;i>=0;i--)
			cout<<arr[i][j]<<",";
		}
		
		   }
		   cout<<"END";

return 0;
}

@avnoorsingh488 give space after comma while printing.

:man_dancing::man_dancing:

1 Like