Only one TC is passing

Pls check my code…
Only 1 TC is passing…

@soumakpoddar55
Code is fine
Issue is with modulo
When taking modulo
Always do
( ( X % M ) + M ) % M
Line 15 might store negative value in dp[i]
Final ans may turn out to be negative

Can u pls correct my code and send it to me…m not able to get the error…
thnx in advance…:slight_smile:

@soumakpoddar55