Pattern Recognition Drill
Medium Backtracking
The Problem
Find all unique combinations that sum to target. Numbers can be reused.
What approach would you use?
Think about it before scrolling down.
Recurse: for each candidate from start, subtract from target, recurse (allowing reuse). Prune when target < 0.
Common Trap
To allow reuse, recurse with same index (not start+1). To avoid duplicates, sort and skip.