Combination Sum

Medium
Arrays Array Backtracking

Find all unique combinations summing to target. Reuse allowed.

Constraints

1 ≤ candidates.length ≤ 30

Examples

Example 1:
Input: 2 3 6 7 7
Output: 2 2 3 7
Example 2:
Input: 2 3 5 8
Output: 2 2 2 2 2 3 3 3 5
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.