Dsa
Backtracking
Easy
Combo Sum Finder
You are given an array of integers and a target sum. Your goal is to find all unique combinations of numbers in the array that add up to the target sum. Each number from the array may be used multiple times in the combination.
Input format:
- The first line contains a list of integers (the array).
- The second line contains the target sum as an integer.
Output format:
- Print each unique combination that adds up to the target sum in ascending order, each on a new line.
Example:
Input:
2 3 6 7
7
Output:
2 2 3
7
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