Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rbarilani/subsetsum
Find all possible combinations of a set of positive numbers to reach a given positive sum target.
https://github.com/rbarilani/subsetsum
Last synced: about 1 month ago
JSON representation
Find all possible combinations of a set of positive numbers to reach a given positive sum target.
- Host: GitHub
- URL: https://github.com/rbarilani/subsetsum
- Owner: rbarilani
- Created: 2015-06-16T13:06:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-16T21:20:47.000Z (over 9 years ago)
- Last Synced: 2024-11-09T07:31:51.440Z (3 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rbarilani-subsetsum (WIP)
Find all possible combinations of a set of positive numbers to reach a given positive sum target.
[![Build Status](https://travis-ci.org/rbarilani/subsetsum.svg)](https://travis-ci.org/rbarilani/subsetsum)
[![Test Coverage](https://codeclimate.com/github/rbarilani/subsetsum/badges/coverage.svg)](https://codeclimate.com/github/rbarilani/subsetsum/coverage)
[![Code Climate](https://codeclimate.com/github/rbarilani/subsetsum/badges/gpa.svg)](https://codeclimate.com/github/rbarilani/subsetsum)## Install
With bower:
```bash
bower install rbarilani-subsetsum --save```
With npm:
```bash
npm install rbarilani-subsetsum --save```
## Usage
### Node
```js
var subsetsum = require('rbarilani-subsetsum');
var result = subsetsum.getSubsets([1,5,3,8], 8);
console.log(result);
// output: [[5,3],[8]]
```### Browser
```html
var result = subsetsum.getSubsets([1,5,3,8], 8);
console.log(result);
// output: [[5,3],[8]]```
## API Reference
Click [here][api-doc].
[api-doc]: https://github.com/rbarilani/subsetsum/blob/master/docs/api.md