Faster way to find all bit arrays of weight n

There’s also this thread on computing the next integer value with the same number of ones set: Computing the preimage of count_ones.

2 Likes