MediumVery High Frequency30 min
Backtracking Fundamentals
The choose-explore-unchoose mental model, decision trees, and pruning strategies.
Backtracking = try a choice, recurse, undo the choice. Build solution incrementally, abandon partial solutions that can't work. Template: choose → explore → unchoose.
Backtracking
Backtracking Pattern
Combination Sum
O(n^(t/m))t = target, m = min coin. Each element reusable (unbounded). Use start index to avoid duplicates.Step-by-step1 / 5
target=7. Start DFS with []
Try each candidate as first element. path=[], remain=7.