Skip to content

Commit ec40f96

Browse files
committed
Runtime: 0 ms (Top 100.00%) | Memory: 43.1 MB (Top 92.66%)
1 parent 95661e1 commit ec40f96

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: 0 ms (Top 100.00%) | Memory: 43.1 MB (Top 92.66%)
12
class Solution {
23
public int[][] transpose(int[][] matrix) {
34
int m = matrix.length;
45
int n = matrix[0].length;
5-
6+
67
int[][] trans = new int[n][m];
7-
8+
89
for(int i = 0; i < n; i++) {
910
for(int j = 0; j < m; j++) {
1011
trans[i][j] = matrix[j][i];
1112
}
1213
}
13-
14+
1415
return trans;
1516
}
16-
}
17+
}

0 commit comments

Comments
 (0)