Given an n x n square matrix of integers, rotate it 90 degrees clockwise and return the rotated matrix.
For example, the top row of the original becomes the right column of the rotated matrix.
matrix = [[1,2,3],[4,5,6],[7,8,9]][[7,4,1],[8,5,2],[9,6,3]]matrix = [[1,2],[3,4]][[3,1],[4,2]]matrix = [[1]][[1]]n == matrix.length == matrix[i].length1 <= n <= 100-1000 <= matrix[i][j] <= 1000Run your code to see results
Use Cmd+Enter to run