Count of numbers having only 1 set bit in the range [0, n]
Given an integer n, the task is to count the numbers having only 1 set bit in the range [0, n].Examples: Input: n = 7 Output: 3 Explanation: 000, 001, 010, 011, 100, 101, 110 and 111 are the binary representation of all the numbers upto 7. And there are only 3 numbers ( 001, 010 and 100 ) having onl