Re: rosettacode 500 milestone passed
- Posted by petelomax Mar 16, 2017
- 1785 views
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.)