Bitset<n> in c++

Is there any method or something cool which store array of ‘0’ and use only 1 bit for 1 ‘0’ like bitset in c++…??

There is nothing in the standard library for that, maybe there’s a package on PyPI. I also imagine it wouldn’t be too complicated to build your own package.

Yeah you can find https://pypi.org/project/BitVector/ and https://pypi.org/project/bitarray/ on PyPI for example. I didn’t try any :wink:

Here’s a little pure Python code to get you started.

https://pastebin.com/xv6KDGrF

1 Like