change-maker
Change Maker is a simple general purpose implementation of the 'change making' problem, this module has been created to talk candidates through a greedy (but memoised and sideffectless) implementation of this classic knapsack problem.
Usage
npm install change-maker
const makeChange = ; // Where the first argument is a string representing the amount and the second is the array of coin denominationsconst change = ; // { '100': 2, '50': 0, '25': 1, '10': 0, '5': 1, '1': 4 }
Testing
npm test
npm coverage // runs tests and generates coverage report
Contrubuting
All contributors will abide by the CODE_OF_CONDUCT.md
.
License
MIT