Minimum Steps Bottom UP

Using top-down approach when computed for n=5 then answer was 3 but using bottom-up ans is coming 4
what is wrong with code ??


@ashwani225 the code for bottom up by mentor has error,
in for loop you must check if(i%3==0) and i%2==0 instead of n%2==0.
correct that and you will get correct answer.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.