Expand the pond

getting tle in some of test cases
ide: https://ide.codingblocks.com/s/244708

hello @Vishal123
ur apporach is correct (dsu +floodfill).
i think the checker is not working correctly because editorial solution is also showing tle.

so what should i do to complete this challenge

try to submit this editorial solution -> https://ide.codingblocks.com/s/245772

even this solution is showing tle

yeah because checker has some issue .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.