http://qs1969.pair.com?node_id=180349


in reply to Re: Puzzle: need a more general algorithm
in thread Puzzle: need a more general algorithm

Greediness does not work in general. What if your categories have sizes 15, 15, 10, 10, 15, 15? Your solution comes out with a suboptimal answer.