Count subsequences

i am getting wrong answer through this code
can you tell me my mistake ??
here it is…

hi aditi,
Your code is correct, but there are some cases in MODS in which they make the values negative.
I have marked that in comments.
In future codes also whenever you use mods,just write that line to be safe.


Please let me know if there is any other doubt.

okay i got it. thank you!!