Write a procedure that transposes a square matrix m.
Interface
C++ | typedef vector< vector<int> > Matrix; |
void transpose(Matrix& m); | |
Java | public static void transpose(int[][] m); |
Python | transpose(m) # returns None |
MyPy | transpose(m: list[list[int]]) -> None |
Precondition
m is a square matrix n× n with n≥0.