Skip to content

Instantly share code, notes, and snippets.

@grumpitect
grumpitect / generate_k_combination.js
Last active August 17, 2021 10:13
non recursive k-combination
const N = 7;
const M = 4;
const positions = [];
for (let i = 0; i < M; i += 1) {
positions.push(i);
}
const set = [];
for (let i = 0; i < N; i += 1) {