subset-sum

Find all combinations that add up to given number python with list of lists

Find all combinations that add up to given number python with list of lists Question: I’ve seen plenty of threads on how to find all combinations that add up to a number with one list, but wanted to know how to expand this such that you can only pick one number at a time, from …

Total answers: 3

maximum difference in the summation of two subset

maximum difference in the summation of two subset Question: I have an array with N elements. I have to divide the array into two subset such that one subset has exactly M elements and the other subset has the rest. Dividing the items into subset in a way such that the difference in the summation …

Total answers: 2

Find all combinations of a list of numbers with a given sum

Find all combinations of a list of numbers with a given sum Question: I have a list of numbers, e.g. numbers = [1, 2, 3, 7, 7, 9, 10] As you can see, numbers may appear more than once in this list. I need to get all combinations of these numbers that have a given …

Total answers: 6