4 test case are not passing

Sir/Ma’am,

My logic seems to be working but 4 test cases are showing wrong answer can you please check my code any figure out what’s wrong

Link : https://ide.codingblocks.com/s/289700

@sinhadivyam19 don’t take modulo only for answer! take it while computing dp[i] also.
see this

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.