Transpose a matrix
mediumLists20 XP
matrix is a list of rows, all the same length. Return its transpose: row i of the answer is column i of matrix.
Examples
- Input: matrix = [[1, 2, 3], [4, 5, 6]]Output: [[1, 4], [2, 5], [3, 6]]
- Input: matrix = [[7]]Output: [[7]]
Examples use JSON: true/false/null are True/False/None in Python.