The Only C Solution
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```\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 */\nint** largestLocal(int** grid, int gridSize, int* gridColSize, int* returnSize, int** returnColumnSizes){\n       int row=0,col=0,*p=0,tot=0,gret=0,ind=0,maxc=3,maxr=3,loop=0,**ans=0,loc=0;\n    tot=(gridSize-2)*(*gridColSize-2);\n    p=(int*)calloc(tot,sizeof(int));\n for(int i=0;i<tot+loop;i++){\n        if((gridSize-row)>=3 && (*gridColSize-col)>=3){\n                for(int k=row;k<maxr;k++){\n                    for(int j=col;j<maxc;j++){\n                        if(grid[k][j]>gret){\n                            gret=grid[k][j];\n                        }\n                    }\n                }\n                col++;\n                maxc++;\n                p[loc]=gret;\n                loc++;\n                gret=0;\n        }\n        else{\n          loop++;\n            row++;\n            maxr++;\n            col=0;\n            maxc=3;\n        }\n\n    }\n\n    ans=(int**)calloc((gridSize-2),sizeof(int*));\n  (*returnColumnSizes)=(int*)calloc((gridSize-2),sizeof(int));\nloc=0;\n    for(int i=0;i<(gridSize-2);i++){\n        ans[i]=(int*)calloc((*gridColSize-2),sizeof(int*));\n        returnColumnSizes[0][i]=(*gridColSize-2);\n        for(int j=0;j<(*gridColSize-2);j++){\n            ans[i][j]=p[loc];\n            loc++;           \n        }\n    }\n*returnSize=(gridSize-2);\nfree(p);\nreturn ans;\n}\n```
['C']