Test case -wrong answer

heyy please check this code . One test case is showing wrong answer.

#include
using namespace std;

int main() {
int m,n,i,j,minrow,maxrow,mincol,maxcol;
cin>>m>>n;
int arr[m][n];

for(i=0;i<m;i++)
{
    for(j=0;j<n;j++)
    {
        cin>>arr[i][j];
    }
}

minrow=0, maxrow=m-1, mincol=0, maxcol=n-1;
while(minrow<=maxrow && mincol<=maxcol)
{
    if(mincol<maxcol){
    for(i=minrow;i<=maxrow;i++)
    {
        cout<<arr[i][mincol]<<", ";
    }
    mincol++;
    }
    
    for(i=mincol;i<=maxcol;i++)
    {
        cout<<arr[maxrow][i]<<", ";
    }
    maxrow--;
    
    for(i=maxrow;i>=minrow;i--)
    {
        cout<<arr[i][maxcol]<<", ";
    }
    maxcol--;
    
    if(minrow<maxrow){
    for(i=maxcol;i>=mincol;i--)
    {
        cout<<arr[minrow][i]<<", ";
    }
    minrow++;
    }
}
cout<<"END";
return 0;

}

Hello @Aparna,

You have applied wrong conditional checks in your code.
I have corrected your code:

Hope, this would help.
Give a like if you are satisfied.