Number of Bit Changes to Make Two Integers Equal
Compare n and k bit by bit: each bit set in n but not in k costs one change, and a bit set only in k is impossible.
Compare n and k bit by bit: each bit set in n but not in k costs one change, and a bit set only in k is impossible.