code: https://ide.codingblocks.com/s/562606
I traverse through the grid and whenver I find a 0 I change it to 1 and apply dfs on the grid after the call finishes I backtrack and change it to 0 again and check the answer produced by the recursive call.
Is there any way this problem can be submitted using recursion only?