3 ms·
2x$0.10 + 1x$0.18 is the preferred change.
by popularrecluse 3y ago
2x$0.10 + 1x$0.18 is the preferred change.
- saulpw 3y agoAnd what algorithm did you use to find that? As per the comment you replied to, the greedy algorithm no longer works, and you have to exhaustively search through all possibilities of coins.
- couchand 3y agoNot the OP, but they appear to use the classic change-making algorithm "Dimes are Best". It works like this: give dimes for change, they're the best coin (highest value density).
- stevage 3y agoNot in the system where the 10c is replaced by the 18c.