I want to do a benchmark in rust, using boolean array of size 1_000_000 to generate all the combinations in the array.
There is a python implementation at the below link along with the output; what would be the rust equivalent using boolean array or vector?
import itertools
def kbits(n, k):
result =
for bits in itertools.combinations(range(n), k):
s = [‘0’] * n
for bit in bits:
s[bit] = ‘1’
result.append(’’.join(s))
return result
print((kbits(4, 3)))