:seat: @combinatorics/permutation
Permutation library for JavaScript. See docs. Parent is js-algorithms.
:warning: Depending on your environment, the code may require
regeneratorRuntime
to be defined, for instance by importing regenerator-runtime/runtime.
import { next , reversed , identity } from '@combinatorics/permutation' ;
next( reversed( identity( 3 ) ) ) ; // [ 0 , 1 , 2 ]