class Solution {

public:

void rotate(vector<vector<int>>& matrix) {

int r = matrix.size();

int c = matrix[0].size();

for (int i = 0; i < r; ++i) {

for (int j = i; j < c; ++j) {

swap(matrix[i][j], matrix[j][i]);

}

}

for(int n = 0; n < r; ++n) {

for (int m = 0; m < c/2; ++m) {

swap(matrix[n][m], matrix[n][c-m-1]);

}

}

}

};