Rotate a square matrix 90 degrees clockwise in-place or return a new matrix.
Constraints
Example
>>> rotate_image([[1, 2], [3, 4]]) [[3, 1], [4, 2]] >>> rotate_image([[1]]) [[1]] >>> rotate_image([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) [[7, 4, 1], [8, 5, 2], [9, 6, 3]]
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints