Optimal game strategy-2

whats wrong
code:https://ide.codingblocks.com/s/238216
ques:https://online.codingblocks.com/app/player/74266/content/76599/4934/code-challenge

@bhaskar0_0,
Your dp table is smaller than required. N can be 10,000, So do should be at least 10000*10000.

it is giving segmentation fault for n=4 also

@bhaskar0_0,
This will not give segmentation fault.