Matrix Rotation
Rotate the grid 90° clockwise: M[r][c] → R[c][rows−1−r].
Matrix
6
3
2
3
5
2
6
1
9
A matrix is an array of arrays — laid out row-major in one contiguous block of memory.
Rotate the grid 90° clockwise: M[r][c] → R[c][rows−1−r].
A matrix is an array of arrays — laid out row-major in one contiguous block of memory.