Problem
Given a matrix A, return the transpose of A.
\( \begin{bmatrix}
1 &2 &3 \\
4 &5 &6 \\
7 &8 &9
\end{bmatrix} \Rightarrow \begin{bmatrix}
1 &4 &7 \\
2 &5 &8 \\
3 &6 &9
\end{bmatrix} \)
Java
1 | class Solution { |
Submission Detail
- 36 / 36 test cases passed.
- Runtime: 0 ms, faster than 100.00% of Java online submissions for Transpose Matrix.
- Memory Usage: 40.6 MB, less than 91.67% of Java online submissions for Transpose Matrix.