Binary Manipulation
Given an integer, store its binary representation bin as a string or an array with digits indexed from 0 to length(bin)-1. Reduce its binary representation to zero by using the following operations:
1. chage the ith binary digit only if (i+1)th bunary digit is 1 and all other binary digits from (i+2) to the end are zeros.
2. change the rightmost digit without restriction.
what are minimum number of operations required to complete the ask?