Stage 1 · Code
Backtracking
Combinations
Combinations of k from n, combination sum variants.
Combinations (k from n)
Choose k elements from 1..n. Backtrack: try including each number from start to n, recurse with start+1.
Combination Sum
Find all unique combinations of candidates that sum to target. Each candidate can be used unlimited times. Sort candidates, backtrack with start index (allow reuse by passing i, not i+1).
Combination Sum II
Each candidate used at most once. Similar to combination sum but pass i+1. Skip duplicates: if same as previous AND previous not used in this position, skip.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.