Hi All,

Struggling with the Exact Change challenge.

When I run my code, I get the right answers. In fact, I get the same answer as when I run the solution provided by this forum in the Algorithms section.

Here is my code:

```
var denominations = [
{ name: 'ONE HUNDRED', value: 100 },
{ name: 'TWENTY', value: 20 },
{ name: 'TEN', value: 10 },
{ name: 'FIVE', value: 5 },
{ name: 'ONE', value: 1 },
{ name: 'QUARTER', value: 0.25 },
{ name: 'DIME', value: 0.10 },
{ name: 'NICKEL', value: 0.05 },
{ name: 'PENNY', value: 0.01 }
];
function checkCashRegister(price, cash, cid) {
var changeDue = cash - price;
var changeGiven = 0;
var changeArray = [];
var drawer = cid.reduce(function(acc, curr) {
acc.total += curr[1];
acc[curr[0]] = curr[1];
return acc;
}, {total: 0});
drawer.total = Math.round(drawer.total * Math.pow(10,2)) / Math.pow(10,2);
if( drawer.total - changeDue < 0 ) {
return "Insufficient Funds";
} else if( drawer.total - changeDue === 0 ) {
return "Closed";
} else {
denominations.forEach(function(denom) {
while( changeDue >= denom.value && drawer[denom.name] > 0 ) {
drawer[denom.name] -= denom.value;
changeDue -= denom.value;
changeDue = Math.round(changeDue * Math.pow(10,2)) / Math.pow(10,2);
changeGiven += denom.value;
}
if( changeGiven > 0 ) {
changeArray.push([denom.name,changeGiven]);
changeGiven = 0;
}
});
}
// Here is your change, ma'am.
return changeArray;
}
```

Somebody please…