Getting TLE in last 3 test cases.
Check out.
Optimal game strategy - II
Hey friend your approach seems to be right, just make your dp array global of size as of required constraints. Cause you are initialising it multiple times which gives you run time error. Hope this would help
Yeah it worked. Thanks bro
Your welcome bro