int projectionArea(int** grid, int gridSize, int* gridColSize){
int sum=0,i,j,count=0;
int colMax[51] = {0};
int rowMax[51] = {0};
for (i=0; i<gridSize; i++)
{
for (j=0; j<gridColSize[i]; j++)
{
if (grid[i][j] > colMax[j]) colMax[j] = grid[i][j];
if (grid[i][j] > rowMax[i]) rowMax[i] = grid[i][j];
if (grid[i][j] == 0) count++;
}
}
for (i=0; i<gridSize; i++)
{
sum+= colMax[i] + rowMax[i];
}
return sum + gridSize*(*gridColSize) - count;
}