Here is my recursive solution which is passing all testcases. But I am not able to convert it into DP solution. Please help.
Optimal Strategy for game
@vaishnavtannu
you just have to apply memoization using the parameter i and j.
To illustrate it, I have done the changes in your code so that it will pass Optimal Game Strategy II.