4 ms·
Any solution with a bounded loop is O(1) too, as would be the case for a loop on the bits of a 32- or 64-bit uint. What makes this interesting is that it's loo
by reikonomusha 11y ago
Any solution with a bounded loop is O(1) too, as would be the case for a loop on the bits of a 32- or 64-bit uint.
What makes this interesting is that it's loopless and compiles to only a few instructions.