npm

Share private packages across your team with npm Orgs, now with simplified billing via the aws marketplace!Learn more Β»

permutated

2.0.0Β β€’Β PublicΒ β€’Β Published


π“Ÿβ„―π“‡π‘šπ“Šπ“‰π’Άπ“‰β„―π’Ή

Get all available combinations


In mathematics, permutation is the act of arranging the members of a set into a sequence or order, or, if the set is already ordered, rearranging (reordering) its elements a process called permuting. Permutations differ from combinations, which are selections of some members of a set regardless of order.

Read More...

Complexity?

7 letters word ~> 7! ~> 5040 available combinations to generate.

Install

$ npm install permutated

Usage

constΒ permutatedΒ =Β require('permutated');
Β 
permutated('abc'));
//=>Β [Β 'abc',Β 'acb',Β 'bac',Β 'bca',Β 'cab',Β 'cba'Β ]
Β 
permutated.numberOfPermutations('1234567'));
//=>Β 5040

API

permutated(word)

Return type: string[] | string

Return all the permuations available from a string.

word

Type: string

The string to permutate.

numberOfPermutations(word)

Return Type: number

Get the number of permuations avilable in a string.

word

Type: string

The string to permutate.

Related

  • all-words: Generate all available words super fast

License

MIT Β© Carlos Abraham

install

npm i permutated

Downloadsweekly downloads

1

version

2.0.0

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability