For this Question: Given an integer X find an integer Y such that Y has exactly two set bits in its binary representaion and abs(X- Y) is minimum.Input contains a single integer X.

Constraints 
1 <= X <= 10^15Print a single integer, the minimum value of abs(X- Y).Sample input 1
5

Sample output 1
0

Explanation: Y=5.

Sample input 2
1

Sample output 2
2

Explanation: Y=3, I have written this Solution Code: n = int(input())
ans = 10000000000000000

count = 0
temp = n
while (temp // 2 > 0):
    count += 1
    temp //= 2

if (n == 1 or n == 2 or n == 3):
    print(3-n)
else:
    for i in range(count + 1, -1, -1):
        for j in range(i-1, -1, -1):
            ans = min(ans, abs(n - ((1 << i) + (1 << j))))
    print(ans), In this Programming Language: Python, Now tell me if this Code is compilable or not?