simple and easy understand solution
if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n# Code\n\nclass Solution {\npublic:\n    vector<vector<int>> largestLocal(vector<vector<int>>& grid) \n   
# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n# Code\n```\nclass Solution {\npublic:\n    vector<vector<int>> largestLocal(vector<vector<int>>& grid) \n    {\n        int n = grid.size();\n        vector<vector<int>>ans;\n        vector<int>tmp;\n        int mx = 0;\n        for(int i=0;i<n-2;i++)\n        {\n            for(int j=0;j<n-2;j++)\n            {\n                for(int x=i;x<i+3;x++)\n                {\n                    for(int y=j;y<j+3;y++)\n                    {\n                        // cout<<x<<y<<" ";\n                        mx = max(mx, grid[x][y]);\n                    }\n                    // cout<<endl;\n                }\n                // cout<<endl;\n                tmp.push_back(mx);\n                mx = 0;\n            }\n            ans.push_back(tmp);\n            tmp.clear();\n        }\n        return ans;\n    }\n};\n```
['Array', 'C', 'Matrix', 'Simulation', 'Python', 'C++', 'Java', 'Python3', 'JavaScript', 'C#']