Solution c++ no use of inbuilt function


#1
void Solution::rotate(vector<vector<int> > &A) {
    
    int n = A.size()-1;
    
    for(int i=0;i<=n;i++)
    {
        for(int j=i;j<=n-i;j++)
        {
            // cout<<i<<" "<<j<<endl;
            if(j==n-i) continue;
            int t1 = A[i][j], t2 = A[j][n-i], t3 = A[n-i][n-j], t4 = A[n-j][i];
            
            A[j][n-i] = t1;
            A[n-i][n-j] = t2;
            A[n-j][i] = t3;
            A[i][j] = t4;
        }
    }
    return;
}