I am trying to solve a puzzle where I have broken it down into 2 separate problems that both require recursion. When the 1st recursive problem is solved I want to then call the next recursive problem and when that is solved the puzzle is then complete. My problem is when the 1st recursive problem comes up with a solution that solves its problem but its not the right solution to solve the puzzle and the second recursive case fails.
For example if you have a puzzle C, that is broken into 2 Parts A and B. You would then use the solution for A, to solve B, and solving B would solve C.
My question is how would the recursion be setup (where the recursive calls would go so if the 2nd part failed it would then find a new solution to the 1st part)?