I have a very long "list" of numbers ( maybe thousands ) which may be grouped, by sum into "n" groups. The number of groups and values are given. For example:
- List of numbers: [1, 2, 5, 6, 7, 8.5, 10]
- Groups:[3, 15, 21.5]
I need to find a summary of which numbers in the "list" will crate given "groups".
- 3 = 1+2
- 15 = 5+10
- 21.5 = 6+7+8.5
Ideas?