Solving problems using simple recursion and recursive backtracking