Python
def get_count_1_of_value(value): count = 0 while(value > 0): value = value & (value - 1) count = count + 1 return count
时间: 2024-10-11 04:39:20
Python
def get_count_1_of_value(value): count = 0 while(value > 0): value = value & (value - 1) count = count + 1 return count