A matrix is a list of rows, each row a list of the same length. Return its transpose: the matrix whose rows are the columns of the original. The element at row i, column j moves to row j, column i.
A matrix with no rows, or with rows that have no columns, transposes to [].
Example 1
Input:
transpose_matrix([[1, 2, 3], [4, 5, 6]])
Output:
[[1, 4], [2, 5], [3, 6]]
Example 2
Input:
transpose_matrix([[7]])
Output:
[[7]]
0 <= rows * cols <= 250000No results yet
Run your code to check it against the examples, or submit to run every test.