:zebra: @combinatorics/n-permutations
Set n-permutations for JavaScript. See docs.
:warning: Depending on your environment, the code may require
regeneratorRuntime
to be defined, for instance by importing regenerator-runtime/runtime.
import {permutations} from '@combinatorics/n-permutations';
permutations("ABCD", 2); // AB AC AD BA BC BD CA CB CD DA DB DC
import {range} from '@iterable-iterator/range';
permutations(range(3), 3); // 012 021 102 120 201 210