Find closest integer with the same weight
Find closest integer with the same weight Question: I am trying to solve this problem: Write a program which takes as input a nonnegative integer x and returns a number y which is not equal to x, but has the same weight (same number of bits set to 1) as x and their difference is …