Hello.
This is the first time I write for help. I’m sure the answer is obvious but I can’t see it for myself.
My doubt is not about coding or how to solve the challenge. I’m sure I’ll manage to do that by myself once I understand the problem. Here is a test case for this challenge and the expected output:
checkCashRegister(3.26, 100, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]])
should return {status: "OPEN", change: [["TWENTY", 60], ["TEN", 20], ["FIVE", 15], ["ONE", 1], ["QUARTER", 0.5], ["DIME", 0.2], ["PENNY", 0.04]]}
.
My question is… why does it has to be this exact combination of currencies and amounts? There are many ways to get to change due (96.74) other than this one. For example,
{status: "OPEN", change: [["TWENTY", 80], ["TEN", 10], ["FIVE", 5], ["ONE", 1], ["QUARTER", 0.5], ["DIME", 0.2], ["PENNY", 0.04]]}
.
What am I missing? Once again, I’m sure the answer is obvious and it is probably stated on the challenge’s instructions but I can’t seem to find it by myself.
Thanks for your help and your time. Once I get it should be able to beat this challenge.