Count numbers up to N whose rightmost set bit is K
Given two positive integers N and K, the task is to count the numbers from the range [1, N] whose Kth bit from the right, i.e. LSB, is the rightmost set bit. Examples: Input: N = 15, K = 2Output: 4Explanation:(2)10 = (010)2, (6)10 = (110)2, (10)10 = (1010)2, (14)10 = (1110)2 have the 2nd bit from th