Expected output: “ONE”:1, “DIME”:0.3
Actual output: “INSUFFICIENT_FUNDS”
So…What’s going on here? I thought about this challenge a lot…
There is somthing deeper here I think, and I’m not sure how to write algorithm for all cases…
Any help?
Thanks!
luckily, the tests do not include a situation like this
the issue here is because the expected solution just checks the denominations from highest to lowest, giving as much as possible of each one, so after giving 1.25$ in ones and quarters, you can’t give 0.05$ in dimes
the actual algorithm used by real cash registers, is more complex than this