c++ | easy | short
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 {\npublic:\n    vector<vector<int>> largestLocal(vector<vector<int>>& grid) {\n        \n        int n = grid.size();\n        \n        vector<vector<int>> ans(n-2,vector<int>(n-2));\n        \n        \n        for(int i=0;i<n-2;i++){\n            for(int j=0;j<n-2;j++)\n                ans[i][j] = maxIn3x3(grid, i, j);\n        }    \n        \n        return ans;\n    }\n    \n    \n    int maxIn3x3(vector<vector<int>> &arr, int i, int j)\n\t{\n        int maxVal = INT_MIN;\n        \n        for(int x = i ; x < i+3 ; x++){\n            for(int y = j; y < j+3 ; y++)\n                maxVal = max(arr[x][y], maxVal);\n        }\n\n        return maxVal;\n    }\n    \n};\n\n```
['C++']