Dsa
Backtracking
Medium
Combination Sum with Constraints
Given an array of integers and a target integer, find all unique combinations in the array that sum up to the target, where each number in the array can be used only once in the combination. The combinations should be returned in any order.
Input Format:
The first line contains space-separated integers representing the array, followed by a single integer target.
Example Input:
10 1 2 7 6 5
8
Output Format:
A list of unique combinations that sum up to the target.
Example Output:
[[1, 7], [2, 6]]
Key concepts
backtrackingcombinationssum
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now