Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

change-maker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

change-maker

An implementation of the change-making problem

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

change-maker

Circle CI

Coverage Status Dependency status Dependency status npm version Known Vulnerabilities

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 = require('change-maker');

// Where the first argument is a string representing the amount and the second is the array of coin denominations
const change = makeChange('$2.34', [100, 50, 25, 10, 5, 1]); // { '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

Keywords

FAQs

Package last updated on 01 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc