Transpose Of Matrix With Dimension N X N
easy
1. You have a matrix of N*N Dimension. 2. You have to convert matrix into transpose. 3. Transpose matrix is defined as, matrix flipped over its main diagonal.
Constraints
1. n == matrix.length 2. 1 <= n <= 1000 3. 1 <= n * n <= 10^5 4. -10^9 <= matrix[i][j] <= 10^9
Format
Input
matrix = { {11, 12, 13}, {21, 22, 23}, {31, 32, 33} }
Output
res = { {11, 21, 31}, {12, 22, 32}, {13, 23, 33} }
Example
Sample Input
3
11 12 13
21 22 23
31 32 33
Sample Output
11 21 31
12 22 32
13 23 33