In the video, bhaiya said that in the case when i is even, we will only consider the case when it is formed from either i/2 or i-1. He said we’ll ignore the case of i+1 as it’s cost will be higher. I don’t understand this. Why would it higher?
For eg.
Suppose we want to make 14
Doubling Cost is 1
Incr Cost is 50
Decr Cost is 50
1 -> 2 -> 4 -> 8 -> 16 -> 15 -> 14
Cost: 1 x 4 + 50 + 50 = 104
Now, here we can’t come to a lower cost without going through 15.
PS: I have checked this ans but it wasn’t still clear: