You start with 0 and you have to Find the minimum number of operations to reach 'n'. In one operation you can add or subtract any 2^k to your current number. Where k can be any positive integer. <br>↵
Constraints: <br>↵
test cases <200,000; <br>↵
1 <= | n | <= 1,000,000,000 . ↵
↵
[cut]↵
↵
Example:<br>↵
INPUT:↵
5↵
1↵
2↵
0↵
6↵
10↵
OUTPUT:↵
1↵
1↵
0↵
2↵
2 <br>↵
First line is no. of test cases, then a single integer 'n' on each line. <br>↵
5 <br>↵
1 <br>↵
2 <br>↵
0 <br>↵
6 <br>↵
10 <br>↵
OUTPUT: <br>↵
1 <br>↵
1 <br>↵
0 <br>↵
2 <br>↵
2 <br>↵
Can anybody help??↵
Constraints: <br>↵
test cases <200,000; <br>↵
1 <= | n | <= 1,000,000,000 . ↵
↵
[cut]↵
↵
Example:<br>↵
INPUT:
5↵
1↵
2↵
0↵
6↵
10↵
OUTPUT:↵
1↵
1↵
0↵
2↵
2
First line is no. of test cases, then a single integer 'n' on each line. <br>↵
5 <br>↵
1 <br>↵
2 <br>↵
0 <br>↵
6 <br>↵
10 <br>↵
OUTPUT: <br>↵
1 <br>↵
1 <br>↵
0 <br>↵
2 <br>↵
2 <br>↵
Can anybody help??↵