void dfs(int** image, int imageSize, int colsize, int r, int c, int newColor, int initColor){
if(r<0 || r>=imageSize || c<0 || c>=colsize || image[r][c]!=initColor || image[r][c]==newColor) return;
image[r][c]=newColor;
dfs(image,imageSize,colsize,r-1,c,newColor,initColor);
dfs(image,imageSize,colsize,r+1,c,newColor,initColor);
dfs(image,imageSize,colsize,r,c-1,newColor,initColor);
dfs(image,imageSize,colsize,r,c+1,newColor,initColor);
}
int** floodFill(int** image, int imageSize, int* imageColSize, int sr, int sc, int newColor, int* returnSize, int** returnColumnSizes){
dfs(image,imageSize,*imageColSize,sr,sc,newColor,image[sr][sc]);
*returnSize=imageSize;
(*returnColumnSizes)=imageColSize;
return image;
}