Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Bitmask & Shift solution in Creative category for Binary Count by arma
def checkio(number):
"""
Find number of ON bits in integer with bitmask and shift
"""
counter = 0
while(number):
if number & 0b1:
counter += 1
number >>= 1
return counter
March 9, 2015
Comments: