if(i%3==0)
{
count1 = dp[i/3];
}
if(i%2==0)
{
count2 = dp[i/2];
}
Instead of check that (n%2) i think we should check i%2 or i%3..right?
Yes you are right, i should be used instead of n.
if(i%3==0)
{
count1 = dp[i/3];
}
if(i%2==0)
{
count2 = dp[i/2];
}
Yes you are right, i should be used instead of n.