EPI Java 11.10 Find the Duplicate and Missing Elements differ-bit logic

#1

In the question 11.10 Find the Duplicate and Missing Elements on EPI Java, could someone please explain the logic for only targetting the numbers in the array and the numbers from 0 to n-1 that have the least significant bit set to 1? I understand that this is the first bit that differs between the missing and duplicate numbers.

0 Likes