Transpose Matrix
Easy
Arrays
Array
Matrix
Given a matrix, return its transpose. Rows become columns.
Constraints
1 ≤ m, n ≤ 1000
Examples
Example 1:
Input: 1 2 3
4 5 6
Output: 1 4
2 5
3 6
Example 2:
Input: 1 2
3 4
5 6
Output: 1 3 5
2 4 6
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console