48. Rotate Image
Practice Rotate Image for free on NudgeCode: Medium, Array & Hash Table pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
matrix is an n x n grid. Rotate it 90 degrees clockwise in place, without allocating a second matrix, and return nothing.
Example
matrix = [[1,2,3],[4,5,6],[7,8,9]] -> [[7,4,1],[8,5,2],[9,6,3]]
Constraints
- 1 <= n <= 20
- -1000 <= matrix[i][j] <= 1000