Xor pair closest to target K
Anonymous User
84

Given a low and high, return the pair of elements in the range [low, high] whose XOR is closest to given target.
Eg. Input: lo = 2, hi = 4, target = 8
2 xor 3 = 1
2 xor 4 = 6
3 xor 4 = 7 >>>> closest to target
Output: [3,4]

Comments (0)