Reduce N To 1
1. You are given a positive number N. 2. You have to find the minimum number of operations required to convert N into 1. 3. Operations allowed : (i) If n is even, you have to replace n with n/2. (ii) If n is odd, you can replace n with either n-1 or n+1.
1 <= N <= 2147483647
A number N
Check the sample ouput and question video.