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:
Expedia
Microsoft
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early June, 2026
Expedia
Mid-level
Early October, 2025
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
Senior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.