Tap here to switch tabs
Problem
Submissions

Problem: Combination Sum II

Combination Sum II asks you to return every unique combination of array values that adds to a target, using each candidate at most once despite repeated values.

Statement

Given an integer array candidates and an integer target, return all unique combinations of values from candidates whose sum is exactly target.

Each value in candidates may be selected at most once in a combination. The returned list must not contain duplicate combinations, even if candidates contains repeated values.

Note: The order of values inside a combination does not matter, and the order of combinations in the output does not matter.

Constraints:

  • 1≤1 \leq candidates.length ≤100\leq 100

  • 1≤1 \leq candidates[i] ≤50\leq 50

  • 1≤1 \leq target ≤30\leq 30

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Combination Sum II

Combination Sum II asks you to return every unique combination of array values that adds to a target, using each candidate at most once despite repeated values.

Statement

Given an integer array candidates and an integer target, return all unique combinations of values from candidates whose sum is exactly target.

Each value in candidates may be selected at most once in a combination. The returned list must not contain duplicate combinations, even if candidates contains repeated values.

Note: The order of values inside a combination does not matter, and the order of combinations in the output does not matter.

Constraints:

  • 1≤1 \leq candidates.length ≤100\leq 100

  • 1≤1 \leq candidates[i] ≤50\leq 50

  • 1≤1 \leq target ≤30\leq 30