JAVA | 2 ms
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[][] largestLocal(int[][] grid) {\n        int len = grid.length;\n        int max;\n        int[][] m = new int[len-2][len-2];\n        for(int i = 0; i < len - 2; i++){\n            for(int j = 0; j < len - 2; j++){\n                max = 0;\n                for(int x = i; x < i + 3; x++){\n                    for(int y = j; y < j + 3; y++){\n                        if(grid[x][y] > max){\n                            max = grid[x][y];\n                        }\n                    }\n                }\n                m[i][j] = max;\n            }\n        }\n        return m;\n    }\n}\n```
['Java']