Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
13 operations solution in Creative category for Binary Count by aureooms
def checkio ( v ) :
"""
https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
"""
v = v - ( ( v >> 1 ) & 0x55555555 )
v = ( v & 0x33333333 ) + ( ( v >> 2 ) & 0x33333333 )
return ( ( ( v + ( v >> 4 ) & 0xF0F0F0F ) * 0x1010101 ) & 0xFFFFFFFF ) >> 24
April 7, 2015
Comments: