Transposed matrix P27498


Statement
 

pdf   zip   main.cc   main.java   main.py

thehtml

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.

Information
Author
Jordi Petit
Language
English
Translator
Carlos Molina
Original language
Catalan
Other languages
Catalan
Official solutions
C++ Java Python
User solutions
C++ Java Python