Re: rosettacode 500 milestone passed

new topic     » goto parent     » topic index » view thread      » older message » newer message

Drat and double drat. I found a counterexample. With a limit of 10kg:

-- item                     weight value pieces 
{"gold",                    {4,     42,     2}}, 
{"silver",                  {6,     61,     1}}, 
{"bronze",                  {1,     10,     1}} 

My scheme terminates with 2 gold and 1 bronze, value 94, but 1 gold and 1 silver has value 103...

At least the test I left in triggered correctly.

(Although that example looks very trivial, there is a subtlety to it that ~99% of other examples do not have.)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu