867. Transpose Matrix
https://leetcode.com/problems/transpose-matrix/
Python
class Solution:
def transpose(self, matrix: List[List[int]]) -> List[List[int]]:
m, n = len(matrix), len(matrix[0])
result = [[None]*m for row in range(n)]
for row in range(m):
for col in range(n):
result[col][row] = matrix[row][col]
return result