Skip to content

Commit 0652520

Browse files
authored
Create transpose_matrix.py
1 parent 55685bf commit 0652520

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution:
2+
def transpose(self, A: List[List[int]]) -> List[List[int]]:
3+
l=[]
4+
i=0
5+
while(i!=len(A[0])):
6+
x=[]
7+
j=0
8+
while(j<len(A)):
9+
x.append(A[j][i])
10+
j+=1
11+
if(x!=[]):
12+
l.append(x)
13+
i+=1
14+
return(l)

0 commit comments

Comments
 (0)