A funny way to store a []bool (something I call a vlagge-stock), even funnier than a bit mask, is using prime factorization. If ith bit is set, multiply by a known prime. Then you can check what primes were used with division.
A funny way to store a []bool (something I call a vlagge-stock), even funnier than a bit mask, is using prime factorization. If ith bit is set, multiply by a known prime. Then you can check what primes were used with division. No comments
|