largest-local-values-in-a-matrix || Simple and Intuitive Solution
Implementation based Question + Logic\n\n# Code\n\nclass Solution {\npublic:\n    vector<vector<int>> largestLocal(vector<vector<int>>& grid) {\n        int n =
# Implementation based Question + Logic\n\n# Code\n```\nclass Solution {\npublic:\n    vector<vector<int>> largestLocal(vector<vector<int>>& grid) {\n        int n = grid.size();\n        vector<vector<int>>res(n-2, vector<int>(n-2));\n        for(int i=1; i<=n-2; i++){\n            for(int j=1; j<=n-2; j++){\n                int maxi = 0;\n                maxi = max({maxi, grid[i-1][j-1], grid[i-1][j], grid[i-1][j+1]});\n                maxi = max({maxi, grid[i][j-1], grid[i][j], grid[i][j+1]});\n                maxi = max({maxi, grid[i+1][j-1], grid[i+1][j], grid[i+1][j+1]});\n\n                res[i-1][j-1] = maxi;\n            }\n        }\n        return res;\n    }\n};\n```\n![Cute Kitti.png](https://assets.leetcode.com/users/images/27806556-c627-40ab-9865-21e7d86fd8f6_1715489364.0753455.png)\n
['C++']