Not sure what;s going wrong

So my approach is to find clusters and mark them with a code, and against each particular cluster code, I store its size. The i check each and every dry cell to see where can I find such a cell which will join ponds of maximum size (clusters of max size). Here is my code : https://ide.codingblocks.com/s/96440
I tried downloading test cases and the small ones are giving expected output, still it says wrong-answers. Not sure whats wrong, please help

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.