Given an array or object with n keys, I need to find all combinations with length x. Given X is variable. binomial_coefficient(n,x)
x
X
binomial_coefficient(n,x)
And here's the true recursion.
function seq(a,b){ var res = []; for (var i=a; i<=b; i++) res.push(i); return res; } function f(n,k){ if (k === 0) return [[]]; if (n === k) return [seq(1,n)]; let left = f(n - 1, k - 1), right = f(n - 1, k); for (let i=0; i