public class NumberPartitioner
extends java.lang.Object
Given an array of sizes and a target number, provide a list of all possible ways of adding zero or more copies of
each number together to reach the target. More generally, given an array of sizes, an array of the minimum number of
times each size has to occur, and a target, provide a list of all possible ways of adding multiple copies of each
number to reach the target such that each number occurs the specified number of times. e.g. if the sizes are [4, 5,
5], the minimums are [1, 1, 1], and the target is 19, the possible multiplicities are [1, 2, 1] and [1, 1, 2].
This was recently updated and retested and it should work correctly.
6/21/12
- Author:
- cusack