The solution for this task seems to have logic that differentiates from a backtracking approach.
It looks like just a recursion with dfs. Backtracking should explore all possible combinations and backtracking whenever we encounter an invalid combination. But there is no condition when we encounter an invalid combination and do backtracking. Could you please explain why this solution is a backtracking one?
Thanks,
Regards, Anna
Course: https://www.educative.io/collection/10370001/6593625897304064
Lesson: https://www.educative.io/collection/page/10370001/6593625897304064/6290705830117376