DP- Minimum steps bottom up code

In the course lecture, inside for loop it is checked that if (n%3==0) or (n%2==0). Shouldn’t it be i instead of n ?

Also the output of this code for n = 5 is giving 4 whereas the answer should be 3.

Please confirm these doubts.

yes it should be i instead of n;
also dp[5] = 3
if you still get incorrect answer, share your code.

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.