What is the problem with my code?

Hi @shubhampal07

intitailise dp[2] = 2, whereas you have intitialised dp[1] twice. Also remove %MOD as it is not mentioned in question to mod the answer.

Hope it Helps.

@shubhampal07
Please mark your doubt as solved.

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.