I used a global variable to store count and instead of returning true in the base case i returned false so that i can find other solutions as well instead of stopping at first soln.
But instead of 2, my answer is 7 and i cant figure out the issue.
I used a global variable to store count and instead of returning true in the base case i returned false so that i can find other solutions as well instead of stopping at first soln.
But instead of 2, my answer is 7 and i cant figure out the issue.