Why all the test cases are not getting cleared

#include
using namespace std;
void rotate(int ar[][10],int n)
{
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(i<j)
{
swap(ar[i][j],ar[j][i]);
}
}
}
}
int main()
{
int ar[1000][1000];
int n;
cin>>n;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cin>>ar[i][j];
}
}
rotate(ar,n);
for(int i=n-1;i>=0;i–)
{
for(int j=0;j<n;j++)
{
cout<<ar[i][j]<<" ";
}
cout<<endl;
}
return 0;
}

hello @bhupeshgupta
pls save ur code at cb ide and share its link with me

@bhupeshgupta

u forgot to reverse every row.

1 Like

ohk bosss …

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.