Optimal game strategy - II

Getting TLE in last 3 test cases.
Check out.

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 :smiley:

Yeah it worked. Thanks bro :grin:

Your welcome bro :slight_smile: