Skip to content

Commit 409c91d

Browse files
committed
Runtime: 88 ms (Top 77.00%) | Memory: 44.4 MB (Top 78.92%)
1 parent 8e8fc61 commit 409c91d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
// Runtime: 88 ms (Top 77.00%) | Memory: 44.4 MB (Top 78.92%)
12

23
var transpose = function(matrix){
34
let result = []
45
for(let i=0;i<matrix[0].length;i++){
5-
6+
67
let col = []
7-
8-
for(let j= 0;j<matrix.length;j++){
8+
9+
for(let j= 0;j<matrix.length;j++){
910
col.push(matrix[j][i])
1011
}
1112
result.push(col)
1213
}
1314
return result
1415
};
1516

16-
console.log(transpose( [ [1 , 2 , 3] , [ 4 , 5 , 6 ] , [ 7 , 8 , 9 ] ] ) )
17+
console.log(transpose( [ [1 , 2 , 3] , [ 4 , 5 , 6 ] , [ 7 , 8 , 9 ] ] ) )

0 commit comments

Comments
 (0)