Given a positive integer N of int type, you are asked to find the maximum K such that N/(pow(2,K)) is a positive integer.
The input is a positive integer N. (0<N)
Please output pow(2,K).
Hint:
Suppose that N=12, then the answer is 4. Let’s convert 12 and 4 into binary:
You’ll notice that only the 3rd bit of 4 is the same as that of 12, which is 1, and the other bits are all 0. Please use this property to obtain the answer by simple bitwise operation and positive-negative sign conversion.