Minimum steps to bottomup

i am getting different ans by memoization and dynamic programming memoization: for n=5 ans is 3 and for DP at n=5, ans is 4
code link

Hi @sandeep021 please share your code link

code link : https://ide.codingblocks.com/s/191494

Hi @sandeep021
at line 34 and 35
instead of

if (n%3==0)q1=dp[i/3];
if (n%2==0) q2=dp[i/2];

it should be

if (i%3==0) q1=dp[i/3];
if (i%2==0) q2=dp[i/2];

In case of any doubt feel free to ask :slight_smile:
If you got your answer mark your doubt as resolved