The source list.
The list having subsequences.
import { fromArray, subsequences, toArray } from "./list.ts";
import { assertEquals } from "../deps.ts";
const subSeq = subsequences(fromArray([1, 2, 3, 4]));
const sequences = toArray(subSeq).map((seq) => toArray(seq));
assertEquals(sequences, [
[],
[1],
[2],
[1, 2],
[3],
[1, 3],
[2, 3],
[1, 2, 3],
[4],
[1, 4],
[2, 4],
[1, 2, 4],
[3, 4],
[1, 3, 4],
[2, 3, 4],
[1, 2, 3, 4],
]);
Generated using TypeDoc
Creates subsequences of the list.