Very simple approach using c++


#1

void Solution::rotate(vector<vector > &A) {
int i,j;
int n=A.size();
vector<vector> v=A;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
A[i][j]=v[n-1-j][i];//just observe the rotation pattern
}
}

}