Write a function that accepts an array of numbers and a number and returns all combinations of the numbers in the array that sum to the provided number. The result will be an array of arrays. The output arrays should be in order with the fewest numbers required to make the sum first. Each number in the input array can only be used once; if the same number is present in the input array multiple times it can be used once per occurrance. The goal is to find all combination of numbers from the input to reach the total, if the same combination could occur multiple times, you can decide if you return that combination more than once or not, whichever is easier for your implementation.
- the function should be of the form
f(number[], number) => number[][]