A number x supports a number (x+b) where b is the number of set bits in binary representation of x, like if x = 3 then x supports (3+2)=5 as 3 has 2 1’s in its binary representation. Now you are provided with an array of numbers you have to print the supported number corresponding to each of the given number.
No comments:
Post a Comment