Easy Java Solution
\npublic class Solution {\n    public int[][] matrixReshape(int[][] nums, int r, int c) {\n        int m = nums.length, n = nums[0].length;\n        if (m * n !
```\npublic class Solution {\n    public int[][] matrixReshape(int[][] nums, int r, int c) {\n        int m = nums.length, n = nums[0].length;\n        if (m * n != r * c) return nums;\n        \n        int[][] result = new int[r][c];\n        int row = 0, col = 0;\n        for (int i = 0; i < m; i++) {\n            for (int j = 0; j < n; j++) {\n                result[row][col] = nums[i][j];\n                col++;\n                if (col == c) {\n                    col = 0;\n                    row++;\n                }\n            }\n        }\n        \n        return result;\n    }\n}\n```
[]