sir in the program for this question you are using a if condition like this
if(n%2==0) for every i in the loop ,
shouldn’t it be something like this if(i%2==0) for every value of i in the loop.
For example - if need to compute the value of 6 , we need first need to compute the value of each i’th index which is present before 6.
Bottom Up Approach(Minimum step to one)
1 Like