convert a number m to n with minimum operations. The operations allowed were -1 and *2.

For Eg : 4 and 6. Answer is 2.

1st operation : -1 -> 4-1 = 3.

2nd operation : * -> 3 * 2 =6.

+2 votes

convert a number m to n with minimum operations. The operations allowed were -1 and *2.

For Eg : 4 and 6. Answer is 2.

1st operation : -1 -> 4-1 = 3.

2nd operation : * -> 3 * 2 =6.

...