Minimum Number Of Steps To Reduce N
1. You are given a number N. 2. You have to find the minimum number of operations needed to reduce it to 1. 3. operations allowed are - -> If n is divisible by 2 then you may reduce n to n/2. -> If n is divisible by 3 then you may reduce n to n/3. -> Decrement n by 1.
1 <= arr[i] <= 10^6
A number N
Check the sample output and question video.