I have a list of numbers. I want to group this up to 5 groups and the total size of each group should be as small as possible. What would be a good approach to this?
Sample data
numbers = [52, 86, 102, 122, 964, 1075, 1420]
Possible result
result = [[1420],[1075],[964],[122, 52],[102, 86]]