Was this related to graphs?

This ques was solved using operations on a 2-D array. How is this related to graphs?

hello @shreyaanand2908
you can think this 2d matrix as implicit graph.
where every adjacent cells are connected by edge.

i,e cell (i,j) is connected with -> (i-1,j) , (i,j-1) , (i+1,j) ,(i,j+1)

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.