✅C++ | ✅Simple solution | ✅O(n^2)
\nclass Solution {\npublic:\n    vector<vector<int>> largestLocal(vector<vector<int>>& grid) \n    {\n        int n = grid.size();\n        vector<vector<int>> 
```\nclass Solution {\npublic:\n    vector<vector<int>> largestLocal(vector<vector<int>>& grid) \n    {\n        int n = grid.size();\n        vector<vector<int>> ans(n-2,vector<int> (n-2,0));\n        \n        \n        // find the max for each center value\n        // and store it in (i-1)(j-1)\n        for(int i=1;i<=n-2;i++)\n        {\n            for(int j=1;j<=n-2;j++)\n            {\n                int mx = INT_MIN;\n                mx = max(mx,max(grid[i-1][j-1],max(grid[i-1][j],grid[i-1][j+1])));    // (0,0)(0,1)(0,2)\n                mx = max(mx,max(grid[i][j-1],max(grid[i][j],grid[i][j+1])));          // (1,0)(1,1)(1,2)\n                mx = max(mx,max(grid[i+1][j-1],max(grid[i+1][j],grid[i+1][j+1])));    // (2,0)(2,1)(2,2)\n                \n                ans[i-1][j-1]=mx;\n            }\n        }\n        return ans;\n    }\n};\n```
[]