i & -i store the right most 1 of i only
12 & -12 = 4
0b1100 & 0b0100 = 0b0100 = 4
def lowbit(self, x):
return x & -x
i & -i store the right most 1 of i only
12 & -12 = 4
0b1100 & 0b0100 = 0b0100 = 4
def lowbit(self, x):
return x & -x