Rust | 0ms | 2.3mb
Runtime: 0 ms, faster than 100.00% of Rust online submissions for Reshape the Matrix.\nMemory Usage: 2.3 MB, less than 23.40% of Rust online submissions for Res
Runtime: 0 ms, faster than 100.00% of Rust online submissions for Reshape the Matrix.\nMemory Usage: 2.3 MB, less than 23.40% of Rust online submissions for Reshape the Matrix.\n\n```\nimpl Solution {\n    pub fn matrix_reshape(mut mat: Vec<Vec<i32>>, r: i32, c: i32) -> Vec<Vec<i32>> {\n        let (row, col) = (mat.len(), mat[0].len());\n        if row * col != (r * c) as usize {  return mat } \n        mat.concat().chunks(c as usize).map(|r| r.to_vec()).collect()\n    }\n}\n```
[]