class Solution {
public:
vector<vector<int> > rotateMatrix(vector<vector<int> > mat, int n) {
// write code here
int len = mat.size();
vector<vector<int>> temp = mat;
for (int i = 0; i < len; i++) {
for (int j = 0; j < len; j++) {
mat[j][n-1-i] = temp[i][j];
}
}
return mat;
}
};