Dsa
Matrix
Warm-up
Transpose Matrix
Create a program that computes the transpose of a matrix. The input consists of two integers m and n (the dimensions of the matrix) followed by m lines of space-separated integers representing the matrix. Output the transposed matrix, where rows become columns and vice versa.
Example:
Input:
2 3
1 2 3
4 5 6
Output:
1 4
2 5
3 6
Key concepts
matrixtransposearray
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now