Get the latest tech news
From hours to 360ms: over-engineering a puzzle solution
where my words occasionally escape /dev/null
By shifting 1 ( 0b0000000001) left by the digit's value, each single-digit number gets mapped to a different bit in the binary representation: This speeds up is_good quite a bit, but scalar (non-SIMD) operations still take up a large portion of the time spent. Because when a number is "good", its bitset complement will be a power of 2, which has a special property in floating point representation — its mantissa bits are all zero:
Or read this on Hacker News