Basic C++ solution using stack


void Solution::rotate(vector<vector > &A) {
// Do not write main() function.
// Do not read input, instead use the arguments to the function.
// Do not print the output, instead return values as specified
// Still have a doubt. Checkout for more details
stack s;
for(int i=0;i<A.size();i++){
for(int j=0;j<A[i].size();j++){
for(int i=A.size()-1;i>=0;i–){
for(int j=0;j<A.size();j++){
A[i][j] =;