question: find two non repeeating number using xor
what is the meaning of
int set_bit = XOR & ~(XOR-1);
question: find two non repeeating number using xor
what is the meaning of
int set_bit = XOR & ~(XOR-1);
hello @aarijrab
this line will give ur righmost set bit of xor.
for example ->
if xor -> 1110
then
set_bit_no = xor & ~(xor-1) = (1110) & ~(1101) = 0010 (note : it is righmost set bit of xor)
will it give the position or the actual value of rightmost set bit…for eg if xor=3…then answer = 1…then what is 1…it is the position of rightmost set bit or what
no it is not position , it is decimal value of binary 0000001