Write a function that takes in a list of integers and a target sum, and returns a
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a function that takes in a list of integers and a target sum, and returns a list of all distinct sets of integers from the input list that add up to the target sum. Each set should contain at most one instance of each integer from the input list, and the sets should be sorted in lexicographic order. For example, if the input list is [10, 1, 2, 7, 6, 1, 5] and the target sum is 8, the function should return [[1, 7], [1, 2, 5], [2, 6], [1, 1, 6]].
Related Book For
Discovering Advanced Algebra An Investigative Approach
ISBN: 978-1559539845
1st edition
Authors: Jerald Murdock, Ellen Kamischke, Eric Kamischke
Posted Date: