Given an integer, and a range of integers (both positive and negative) as input.
We need to calculate the possible combinations of the integers from the range that add up to the given integer.
For example:
Integer: 5
Range: -1, 0, 1, 2, 3, 4
Result:
[1, 4], [2, 3], [-1, 2, 4], [0, 1, 4], [0, 2, 3], [-1, 0, 2, 4], [-1, 1, 2, 3], [-1, 0, 1, 2, 3]
围观 from kohana group..