✅ [Python] Two loop solution
\nclass Solution:\n    def largestLocal(self, grid: List[List[int]]) -> List[List[int]]:\n        n = len(grid)\n        matrix = [[1]* (n-2) for i in range(n-2
```\nclass Solution:\n    def largestLocal(self, grid: List[List[int]]) -> List[List[int]]:\n        n = len(grid)\n        matrix = [[1]* (n-2) for i in range(n-2)]\n        for i in range(1, n - 1):\n            for j in range(1, n - 1):\n                matrix[i-1][j-1] = max(grid[i-1][j-1], grid[i-1][j], grid[i-1][j+1],\n                                  grid[i][j-1], grid[i][j], grid[i][j+1],\n                                  grid[i+1][j-1], grid[i+1][j], grid[i+1][j+1])\n        return matrix\n```\n
['Python', 'Python3']