139: Combination sum 2

Given an array of positive integers and target sum, return all unique combinations of array items that add up to the given sum

Note: Each array item can be used only once

 

Example 1

Input:   array = [2, 6, 2, 6, 8], sum = 8

Output:  [[2, 6], [8]]

Example 2

Input:   array = [2, 4, 8], sum = 15

Output:  []
Difficulty:Medium
Topic:Backtracking
Problem #:139