30 Days of Code [Day 3]
QUESTION : 48. Rotate Image
#define vi vector<int>
#define pii pair<int, int>
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define fo(i,s,n) for(int i=s;i<n;++i)
#define of(i,s,n) for(int i=s-1;i>=n;--i)
#define fv(V) for( auto &it : V )
class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
fo(i,0,matrix.size()){
fo(j,0,i) swap(matrix[i][j], matrix[j][i]);
}
fo(i,0,matrix.size()) reverse(all(matrix[i]));
}
};