The list of values: a = [1,4,3,5,7,9,5,4,5,6,3,2,1,9,4,3,6,4,3,4,6,7]
Group the values so that the the sum of the values in each group does not exceed 10. The aim is to group the values in such a way to have the minimum amount of groups.
In example: Group 1 = [1,9] Group 2 = [2,3,5] etc.
I am looking for an algorithm to solve this problem. Any help would be appreciated, even if it is just setting me on track with what this type of problem is called.