JSPM

interval-digit-sum

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q13612F
  • License

Find all the digits within an interval whose sum equal the target value.

Package Exports

  • interval-digit-sum

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (interval-digit-sum) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

interval-digit-sum

Find all the digits within an interval whose sum equal the target value.

Install

npm install interval-digit-sum
bower install interval-digit-sum

Usage

const intervalDigitSum = require('interval-digit-sum');

const numbers = intervalDigitSum([0,100], 8);

console.log(numbers);
/*
['08', '17', '26', '35', '44', '53', '62', '71', '80']
*/

Unique only (non-repeating numbers)

const numbers = intervalDigitSum([0,100], 8, {
  unique: true
});

console.log(numbers);
/*
['08', '17', '26', '35', '53', '62', '71', '80']
*/

Test

npm test

License

MIT