Not work for all test cases can you plz tell what is wrong with solution
Hi @Rajat-Sharma-2078329489142103
In this question you have to print ans%1000000007; because ans can be a large number and can go out of the range of long long int. So you need to make a single change in you code at line 8 like this :
a[i]=(a[i-1]+a[i-m])%1000000007;
Here is your corrected code :
If your doubt is clear mark it as resolved.
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.