Beats 100% || Easy to understand || Clean & concise
 # Intuition  \n\n\n\n\n\n\n# Complexity\n- Time complexity: O(n^2)\n\n\n- Space complexity: O(n^2)\n\n\n# Code\n\nclass Solution {\n    public int[][] largestL
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\n![beats1.png](https://assets.leetcode.com/users/images/97e238fa-319a-4a8b-82d6-f8c5f1645ccc_1715518409.4729161.png)\n\n# Complexity\n- Time complexity: O(n^2)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n^2)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[][] largestLocal(int[][] grid) {\n        int [][]result=new int [grid.length-2][grid.length-2];\n        for(int row=0;row<grid.length-2;row++)\n        {\n            for(int col=0;col<grid.length-2;col++)\n            {\n                result[row][col]=maxvalue(grid,row,col);\n            }\n        }\n        return result;\n        \n    }\n    public int maxvalue(int [][]grid,int row,int col)\n        {\n            int max=Integer.MIN_VALUE;\n            for(int i=row;i<=row+2;i++)\n            {\n                for(int j=col;j<=col+2;j++)\n                {\n                    max=Math.max(max,grid[i][j]);\n                }\n            }\n            return max;\n        }\n}\n\n```\n![mouse.jpeg](https://assets.leetcode.com/users/images/16b7bcec-a195-45a9-83e7-9b67f2bb93d4_1715518474.9521942.jpeg)\n\n```
['C', 'Python', 'C++', 'Java', 'JavaScript']