Ejercicio: arrays anidados

Los arrays pueden contener otros arrays:

#![allow(unused)]
fn main() {
let array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
}

What is the type of this variable?

Use an array such as the above to write a function transpose which will transpose a matrix (turn rows into columns):

2584567⎤8⎥9⎦transpose==1473⎤6⎥9⎦123

Codifica ambas funciones para que operen con matrices de 3 × 3.

Copia el siguiente fragmento de código en https://play.rust-lang.org/ e implementa las funciones:

// TODO: remove this when you're done with your implementation.
#![allow(unused_variables, dead_code)]

fn transpose(matrix: [[i32; 3]; 3]) -> [[i32; 3]; 3] {
    unimplemented!()
}

fn main() {
    let matrix = [
        [101, 102, 103], // <-- el comentario hace que rustfmt añada una nueva línea
        [201, 202, 203],
        [301, 302, 303],
    ];

    println!("matriz: {:#?}", matrix);
    let transposed = transpose(matrix);
    println!("traspuesto: {:#?}", transposed);
}