I have tried to solve this problem using dfs but I am getting WA. Can anyone provide me a strong test case or point out where I am making the mistake. Here is the link to problem My solution
1 5 5 1 9 1 1 1 1 9 1 9 1 1 1 1 9 1 9 9 9 9 1 9 9 9 9 1 5 5 15