output is fine but wrong on submit and shows test case is wrong
#include
using namespace std;
int main()
{
int M,N;
cin>>M>>N;
if ((M>=1 && M<=10) && (N>=1 && N<=10) )
{
int Array[M][N];
for (int i = 0; i < M; i++)
{
for (int j = 0; j < N; j++)
{
cin>>Array[i][j];
}
}
for (int col = 0; col < N; col++)
{
if (col%2==0)
{
for (int row = 0; row < M; row++)
{
cout<<Array[row][col]<<",";
}
}
else
{
for(int row=M-1;row>=0;row--){
cout<<Array[row][col]<<",";
}
}
}
cout<<"END";
}
return 0;
}
