Concept
Backtracking builds a solution one choice at a time and undoes the last choice when it leads nowhere. One template covers subsets, permutations, combinations and constraint puzzles.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Backtracking templates doing its job.
def subsets(nums):
result, current = [], []
def explore(start):
result.append(current.copy())
for i in range(start, len(nums)):
current.append(nums[i]) # choose
explore(i + 1) # explore
current.pop() # unchoose
explore(0)
return result
subsets([1, 2, 3]) # 8 subsetsAppending current itself to the results instead of a copy. Every entry then refers to the same list, which is empty by the time the function returns.
Your roadmap puts these before Backtracking templates, unless you already know them.
Once a session shows you understand Backtracking templates, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.