02.05 · Problem
Combination Sum
Return every unique combination of candidates that adds up to target. Each number can be used many times. Order doesn’t matter: [2, 2, 3] and [3, 2, 2] are the same. Any order of answers is fine.
Examples
Example 1
Input: candidates = [2, 3, 6, 7], target = 7
Output: [[2, 2, 3], [7]]
Example 2
Input: candidates = [2, 3, 5], target = 8
Output: [[2, 2, 2, 2], [2, 3, 3], [3, 5]]solulu Pro
Continue this problem with Pro
Inside: step-by-step hints · 10 hidden tests · reference solutions · code editor.
Lifetime ₹1,999 ₹999 · Launch offer
Item 16 of 44 · updated 2026-10-13