Question bank › Backtracking
Dsa Backtracking Medium

Subset Sum Combinations

Given a list of integers and a target sum, find all unique combinations of numbers from the list that add up to the target sum. You may use each number from the list an unlimited number of times. The solution set must not contain duplicate combinations. Input: - The first line contains integers n (0 <= n <= 20) followed by n integers representing the list of integers. - The second line contains the target sum. Output: - Print each combination on a new line, with combinations in sorted order. Example: Input: 3 2 3 6 7 Output: 2 2 3 2 6 3 3 3

Key concepts

backtrackingcombinatorialsubset

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
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.