0867. 转置矩阵

# 0867. 转置矩阵#

• 标签：数组
• 难度：简单

## 代码 #

 1 2 3 4 5 6 7 8 9  class Solution: def transpose(self, matrix: List[List[int]]) -> List[List[int]]: m = len(matrix) n = len(matrix[0]) transposed = [[0 for _ in range(m)] for _ in range(n)] for i in range(m): for j in range(n): transposed[j][i] = matrix[i][j] return transposed