Public
Edited
Aug 13, 2023
2 forks
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {range, sorted, permutations} from '@jrus/itertools'
Insert cell
Insert cell
combinations = function* combinations(iterable, r) {
const pool = [...iterable], n = pool.length;
for (let indices of permutations(range(n), r))
if (sorted(indices).join() == indices.join())
yield indices.map(i => pool[i]); }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more