Compiler not giving any verdict

When I run code against sample test cases I get correct answer but when I submit it, the compiler is not giving any verdict. It is submitting and giving no answer(No wrong answer or correct answer)
Here is my code https://ide.codingblocks.com/s/139030

Use dynamic programming. There are repetitive calls, your code is making too many calls, hence no verdict is being shown. Implement dp and get through the problem! :slight_smile:

I implemented memoization in the problem, now I am getting wrong answer. I am not understanding where I am going wrong

Memoized link to code https://ide.codingblocks.com/s/140085

Link to memoized code *