Doubt regarding test cases

could u please check my code and tell which test case my code might not be working for and giving runtime error!
The link for the code is :

ur recursive solution is correct but to pass all test cases u need to use dp.
you can see this:

is there any way to solve it using recursion and get full score?

no,
I dont think so .