Combination Sum II

Given a collection of candidate numbers, find all unique combinations where the candidate numbers sum to a target. Each number in candidates may only be used once in the combination. The solution set must not contain duplicate combinations.

Constraints

  • 1 <= candidates.length <= 100
  • 1 <= candidates[i] <= 50
  • 1 <= target <= 30
Saving… · 2 lines
class Solution:
def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]:
Console

Click Run to execute sample tests.