Simple C solution
Complexity\n- Time complexity: O(n^2)\n\n- Space complexity: O(1) (not considering maxLocal)\n\n# Code\n\n/**\n * Return an array of arrays of size *returnSize.
# Complexity\n- Time complexity: O(n^2)\n\n- Space complexity: O(1) (not considering maxLocal)\n\n# Code\n```\n/**\n * Return an array of arrays of size *returnSize.\n * The sizes of the arrays are returned as *returnColumnSizes array.\n * Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().\n */\n\nint biggestNum3x3(int**mat, int cI, int cJ) {\n    int max = INT_MIN;\n\n    for(int i = 0; i < 3; i++) {\n        for(int j = 0; j < 3; j++) {\n            max = max < mat[i + cI][j + cJ] ? mat[i + cI][j + cJ] : max;\n        }\n    }\n\n    return max;\n    \n}\n\nint** largestLocal(int** grid, int gridSize, int* gridColSize, int* returnSize, int** returnColumnSizes) {\n    int n = gridSize;\n    int m = n - 2;\n    *returnSize = m;\n    *returnColumnSizes = (int *)malloc(m * sizeof(int));\n    \n    int **maxLocal = (int **)malloc(m * sizeof(int *));\n    for(int i = 0; i < m; i++) {\n        maxLocal[i] = (int *)malloc(m * sizeof(int));\n        (*returnColumnSizes)[i] = m;\n    }\n\n    for(int i = 0; i < m; i++) {\n        for(int j = 0; j < m; j++) {\n            maxLocal[i][j] = biggestNum3x3(grid,i,j);\n        }\n    }\n\n    return maxLocal;\n}\n```
['C']