Alternative solution for coins !
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 341
- PR merge metrics
- No merged PRs in 30d
Description
Hi ! thank you very much for you amazing tutorials !
Here is my solution for the coins
```
function getChange (totalPayable, cashPaid) {
var result = [];
var coins = [200, 100, 50, 20, 10, 5, 2, 1];
var diffrence = cashPaid - totalPayable;
var i = 0;
do {
if (coins[i] <= diffrence)
{
result.push(coins[i]);
diffrence = diffrence - coins[i];
}
else
i++;
}
while (i < coins.length);
return result;
}
```
Contributor guide
Research direction
The issue contains an alternative JavaScript getChange solution but names no repository file, exercise location, or requested change. Start by reviewing the coins tutorial and its existing tests, then determine whether this example should be incorporated and what acceptance criteria would apply.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100