Python solution 88.68% Faster
\ndef matrixReshape(self, mat: List[List[int]], r: int, c: int) -> List[List[int]]:\n        if (len(mat) * len(mat[0]) != r * c):\n            return mat\n    
```\ndef matrixReshape(self, mat: List[List[int]], r: int, c: int) -> List[List[int]]:\n        if (len(mat) * len(mat[0]) != r * c):\n            return mat\n        flat_mat = []\n        prop_mat = []\n        for i in range(len(mat)):\n            for j in mat[i]:\n                flat_mat.append(j)\n        end = c\n        for i in range(0,len(flat_mat),c):\n            prop_mat.append(flat_mat[i:end])\n            end += c\n            \n        return prop_mat\n```
['Python']