Optimal Algorithmic Approach
DFS backtracking with remaining sum, allowing element reuse.
Core Invariants & Edge Cases
- Backtrack with a start index; allow reuse by not incrementing start on recursion
- Prune when current sum exceeds target
- Sort candidates for more effective pruning