Java || Simple Solution
java\nclass Solution {\n    \n    int[][] grid;\n    \n    public int[][] largestLocal(int[][] grid) {\n        this.grid = grid;\n        \n\t\t// limit the ro
```java\nclass Solution {\n    \n    int[][] grid;\n    \n    public int[][] largestLocal(int[][] grid) {\n        this.grid = grid;\n        \n\t\t// limit the rows and cols that can be checked\n        int rows = grid.length - 2;\n        int cols = grid[0].length - 2;\n        \n        int[][] local = new int[rows][cols];\n        \n        for (int i = 0; i < rows; i++) {\n            for (int j = 0; j < cols; j++){\n                local[i][j] = findMax(i, j);\n            }\n        }\n        \n        return local;\n    }\n    \n\t// find the max in 3x3 grid\n    public int findMax(int x, int y) {\n        int max = 0;\n        int rows = x + 3;\n        int cols = y + 3;\n        \n        for (int i = x; i < rows; i++) {\n            for (int j = y; j < cols; j++) {\n                if (grid[i][j] > max) max = grid[i][j];\n            }\n        }\n        \n        return max;\n    }\n}\n```
['Java']