Skip to content

Commit

Permalink
chore: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
leo91000 committed Oct 24, 2024
1 parent 730015c commit fe5a422
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,19 @@ pnpm add @leo91000/wasm-subset-sum
## Usage

```ts
import { getSubsetSum } from '@leo91000/subset-sum' // or @leo91000/wasm-subset-sum
import { getSubsetSum, getAllSubsetSums } from '@leo91000/subset-sum' // or @leo91000/wasm-subset-sum
// Get one subset sum
const results = getSubsetSum(
[5, -7, 3, 11], // List to get the subset sum from
8, // Target sum
1000, // Timeout in ms
)

// Or get all subset sums possible sets
const allResults = getAllSubsetSums(
[1, 3, 3, 3, 7],
10,
1000,
)
```

0 comments on commit fe5a422

Please sign in to comment.