Getting wrong answer

i have passed only 2 test case and i can’t understand where i am getting wrong…

see the output format
you have to print ans with taking mod with 10^9+7

Output Format
Print number of possible ways to make change for N cents in a new line. Since answers can be large, print answer % (1000000000 + 7).

even after taking mod i could not get all the test cases passes…!!!

yes 2 testcase will not pass
this is because your code is not memory efficent

you can do it using 1D dp as well

try to do that

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.