Doubt in my code for seq linear recursion problem spoj

Hey ,

I wrote the following code for the lin recursive problem named SEQ which has already been discussed by Prateek bhaiya in the video . My code is not working for this test case . Kindly help me solve the problem

n->98765432
k->3
b->24 354 6
c-> 56 57 465

@imsharan0105
There was a small error in your code. While calculating sum in the last portion of code, you did not perform the modulus operation on the sum variable
Use this line of code.
sum += (ans[1][i] % MOD * b[i] % MOD) % MOD;
It will work out fine. The rest of it was absolutely correct.

If my solution is able to answer your query, please mark the doubt as resolved.