Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as Combinatorics from "js-combinatorics";
const p:number = Combinatorics.P(1, 2);
const c:number = Combinatorics.C(1, 2);
const factorial:number = Combinatorics.factorial(5);
const factoradic:number[] = Combinatorics.factoradic(5);
const power = Combinatorics.power(["a", "b", "c"]);
const nextPower:string[] = power.next();
power.forEach((i:string[]) => console.log(i));
const powersLengths:number[] = power.map((i:string[]) => i.length);
const filteredPowers:string[][] = power.filter((i:string[]) => i.length > 0);
const allPowers:string[][] = power.toArray();
const powersCount = power.length;
const nthPower:string[] = power.nth(3);
const limitedCombination = Combinatorics.combination(["a", "b", "c"], 2);
const combination = Combinatorics.combination(["a", "b", "c"]);
const nextCombination:string[] = combination.next();
combination.forEach((i:string[]) => console.log(i));
const combinationsLengths:number[] = combination.map((i:string[]) => i.length);
import * as Combinatorics from "js-combinatorics";
const p:number = Combinatorics.P(1, 2);
const c:number = Combinatorics.C(1, 2);
const factorial:number = Combinatorics.factorial(5);
const factoradic:number[] = Combinatorics.factoradic(5);
const power = Combinatorics.power(["a", "b", "c"]);
const nextPower:string[] = power.next();
power.forEach((i:string[]) => console.log(i));
const powersLengths:number[] = power.map((i:string[]) => i.length);
const filteredPowers:string[][] = power.filter((i:string[]) => i.length > 0);
const allPowers:string[][] = power.toArray();
const powersCount = power.length;
const nthPower:string[] = power.nth(3);
const limitedCombination = Combinatorics.combination(["a", "b", "c"], 2);
const combination = Combinatorics.combination(["a", "b", "c"]);
const nextCombination:string[] = combination.next();
combination.forEach((i:string[]) => console.log(i));
const combinationsLengths:number[] = combination.map((i:string[]) => i.length);