Sir please explain more about this question in detail with one test case othe then given in this question

sir please explain more about this question in detail with one test case othe then given in this question

@uditkumar652
let say, input is :-
0 0 1 1
0 0 0 0
0 1 1 1

here if we convert the 0 at (1,2) into 1 then it will look like:-
0 0 1 1
0 1 0 0
0 1 1 1
so the maximum size will be 4.

if convert (1,3) into 1, then
0 0 1 1
0 0 1 0
0 1 1 1
here the largest size will be 6.

similarly, convert (1,4)
0 0 1 1
0 0 0 1
0 1 1 1
here again the largest size will be 6.

So 6 is our answer.

Tip:- Use DFS for all the connected components and also store size of each component.

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.