How to find a pair of number (A,B) whose XOR is N such that B is smallest possible

74 Views Asked by At

What I'm trying to figure out here is, if there is any way that I can find such a pair of integer such that one of it is the smallest of any number occurring in any pair of number which satisfies A XOR B = N

1

There are 1 best solutions below

0
On

You can always get your number $N$ by XOR-ing $A=N$ and $B=0$