Skip to content

Commit d6162d4

Browse files
Added solution
1 parent 5588848 commit d6162d4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: 867.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Runtime: 56 ms, faster than 55.21% of Python online submissions for Transpose Matrix.
2+
# Difficulty: Easy
3+
4+
class Solution(object):
5+
def transpose(self, A):
6+
"""
7+
:type A: List[List[int]]
8+
:rtype: List[List[int]]
9+
"""
10+
transpose = list()
11+
for i in range(len(A[0])):
12+
row = list()
13+
for j in range(len(A)):
14+
row.append(A[j][i])
15+
transpose.append(row)
16+
return transpose

0 commit comments

Comments
 (0)