Please check the code
TLE what is the wrong with me code
@rkrishna your approach is not correct ,use this: first we can use a flood fill algorithm to determine the black shapes and their sizes. Then we can take each white cell (there’s no point in changing the colour of a black cell) and see what happens if we choose it. We need to check its black neighbouring cells. We take the shapes of the black neighbours, being careful not to choose the same shape twice, and sum their sizes. The answer is the maximum of these sums plus 11 (for the white chosen cell).
For reference :https://ide.codingblocks.com/s/108413?_ga=2.248004359.1876353381.1594759238-1868378134.1563105121
Flood fill is derivative of dfs right!
I have used dfs only
@rkrishna hey yes in floodfill dfs is used but your logic is not upto the mark check the above logic which I have told .