Two test cases are not passing (Wave print Column wise)

#include
using namespace std;
int main()
{
int M;
cin>>M;

int N;
cin>>N;

int arr[M][N];

for(int i=0;i<M;i++){
	for(int j=0;j<N;j++){
		cin>>arr[i][j];
	}
cout<<endl;
}
int row_start=0;
int row_end=M-1;
int col_start=0;
int col_end=N-1;

while(col_start<=col_end){
	// for printing first column in order
	for(int row=row_start;row<=row_end;row++){
		cout<<arr[row][col_start]<<","<<" ";
	}
col_start++;
		// for printing first column in reverse order

for(int row=row_end;row>=row_start;row--){
		cout<<arr[row][col_start]<<","<<" ";
	}
col_start++;
}

cout<<“END”;
}

hello @vanshit02
pls save this code at cb ide and share its url with me

check now-

got it right now , thanks aman !!

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.