Easy c++, jai bhalayya


#1

void Solution::rotate(vector<vector > &A) {
int a=0; int m=A[0].size()-1; int n=m;
int dir =0;
while(a<n)
{
for(int i=a; i<n; i++)
{
swap(A[a][i],A[i][n]);
swap(A[a][i],A[n][m-i]);
swap(A[a][i],A[m-i][a]);
}
a++; n–;
}
}