🔥Brute Force - Beginner Friendly | Clean Code | C++ |
Code\n\nclass Solution {\npublic:\n    vector<vector<int>> largestLocal(vector<vector<int>>& grid) {\n        int n = grid.size();\n        vector<vector<int>> 
# 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\n        for (int i = 0; i < n - 2; i++)\n        {\n            for (int j = 0; j < n - 2; j++)\n            {\n                int curr = 0;\n                \n                for (int k = 0; k < 3; k++)\n                {\n                    for (int l = 0; l < 3; l++)\n                    {\n                        curr = max(curr, grid[i + k][j + l]);\n                    }\n                }\n\n                res[i][j] = curr;\n            }\n        }\n\n        return res;\n    }\n};\n```
['C++']