LeetCode 40: Combination Sum II (Backtracking / Same-Layer Dedup ACERS Guide)
Subtitle / Summary If 39. Combination Sum teaches “reuse is allowed”, then 40. Combination Sum II teaches the next real upgrade: duplicate values exist, each number may be used at most once, and de-duplication must happen at the correct tree level. Reading time: 14-16 min Tags: backtracking, dedup, pruning, combination search SEO keywords: Combination Sum II, backtracking, same-layer dedup, pruning, LeetCode 40 Meta description: Build the stable solution for LeetCode 40 from scratch by understanding sorted pruning, use-once recursion, and the same-layer duplicate skip rule. A — Algorithm Problem Restatement Given a collection of candidate numbers candidates and a target integer target, return all unique combinations where the chosen numbers sum to target. ...