Skip to content

BelirafoN/sum-variants

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sum Variants

Build Status npm version

Function, which included an array of random select all combinations of numbers whose sum is equal to the specified number

Install

$ npm i sum-variants

Usage

const sumVariants = require('sum-variants');
const srcArr = [.9, 6, '4', 9.1];

console.log(sumVariants(srcArr, 10));
// [[0.9, 9.1], [4, 6]]

Tests

Tests require Mocha.

mocha ./tests

or with npm

npm test 

Test coverage with Istanbul

npm run coverage

License

Licensed under the MIT License

About

All combinations of numbers whose sum is equal to the specified number

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published