Simple Java Solution || Beats 100%
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 n = grid.length;\n        int[][] res = new int[n-2][n-2]; \n        for(int i=0;i<n-2;i++){\n            for(int j=0;j<n-2;j++){\n                res[i][j]=find_max(grid,i,j);\n            }\n        }\n        return res;\n    }\n\n    private int find_max(int[][] grid,int r,int c){\n        int value=Integer.MIN_VALUE;\n        for(int i=r;i<r+3;i++){\n            for(int j=c;j<c+3;j++){\n                value=Math.max(value,grid[i][j]);\n            }\n        }\n        return value;\n    }\n}\n```
['Java']