Education + Jobs Hiring Website - 2025
0 like 0 dislike
1,371 views

For proper oa or interview experiences list of all top tech companies visit :

https://oa.desiqna.in

https://interview.desiqna.in

 

image

 

in Online Assessments by Expert (44,360 points) | 1,371 views

1 Answer

0 like 0 dislike

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?

by Expert (44,360 points)
edited by