2536. Increment Submatrices by One | Java Code
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[][] rangeAddQueries(int n, int[][] queries) {\n    int[][] mat = new int[n][n];\n    for (int[] q : queries) {\n        int row1 = q[0], col1 = q[1], row2 = q[2], col2 = q[3];\n        for (int i = row1; i <= row2; i++) {\n            for (int j = col1; j <= col2; j++) {\n                mat[i][j]++;\n            }\n        }\n    }\n    return mat;\n    }\n}\n```
['Java']