My code gives the expected output as shown, but it still fails test cases. Please check the code and suggest changes:
for(int i=0;i<m;i++){
if(i%2==0){
for(int j=0;j<n;j++)
cout<<a[i][j]<<", β;
}
else{
for(int j=n-1;j>=0;jβ)
cout<<a[i][j]<<β, ";
}
}
cout<<βENDβ;