java modulo arthimatic
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[][] matrixReshape(int[][] mat, int r, int c) {\n        int n = mat.length , m = mat[0].length;\n        int arr[][] = new int[r][c];\n        if(m*n != r*c) return mat;\n        for(int i = 0; i < c*r; i++){\n            arr[i/c][i%c] = mat[i/m][i%m];\n        }\n        return arr;\n    }\n}\n```
['Java']