10 Jul
2007
10 Jul
'07
2:44 p.m.
Am Dienstag, 10. Juli 2007 00:25 schrieb Albert Y. C. Lai:
It disappoints me that there is no solution if each item is used at most once. However, do change the code to allow multiple uses, then there are many solutions.
i see only two solutions. let menu = [215, 275, 335, 355, 420, 580] let run x menu = [[c]|c<-menu,c==x]++[c:cs|c<-menu,c<x,cs<-run (x-c) (dropWhile (/=c) menu)] run 1505 menu -> [[215,215,215,215,215,215,215],[215,355,355,580]]