transpose.py (291B)
1 class Solution: 2 def transpose(self, matrix: List[List[int]]) -> List[List[int]]: 3 result = [] 4 for x in range(0, len(matrix[0])): 5 result.append([]) 6 for y in range(0, len(matrix)): 7 result[x].append(matrix[y][x]) 8 return result