Search
⌘K

Leetcode 40. Combination Sum II

Given a multiset of candidate numbers, return all unique combinations that sum to the target where each candidate may be used at most once. This requires exploring combinations (DFS/backtracking) while handling duplicate values (e.g., sort and skip repeats) to avoid duplicate result sets.

Asked at:

Microsoft

Microsoft

LinkedIn

LinkedIn

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early October, 2025

Microsoft

Microsoft

Mid-level

Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. Each number in candidates may only be used once in the combination. Note: The solution set must not contain duplicate combinations. Write the test cases and everything.

Mid September, 2025

LinkedIn

LinkedIn

Senior

Early January, 2025

Meta

Mid-level

Comments

Your account is free and you can post anonymously if you choose.