classSolution: deftranspose(self, matrix: List[List[int]]) -> List[List[int]]: size_y = len(matrix) size_x = len(matrix[0]) result = [[0for _ inrange(size_y)] for _ inrange(size_x)] for y inrange(size_y): for x inrange(y, size_x): result[x][y] = matrix[y][x] return result