Return the matrix rotated 90 degrees clockwise. A matrix with m rows and n columns becomes a matrix with n rows and m columns. The first row of the input becomes the last column of the output.
Example 1
Input:
rotate_matrix([[1, 2, 3], [4, 5, 6]])
Output:
[[4, 1], [5, 2], [6, 3]]
Example 2
Input:
rotate_matrix([[1]])
Output:
[[1]]
0 <= rows, cols, and rows * cols <= 250000No results yet
Run your code to check it against the examples, or submit to run every test.