Please check code for Optimal Game Strategy-II

hello @sahilkhan2312000131
check now->

dp array is consuming too much memory.

the idea is to store only few entries and for remaining use recusion.

Is there any way to avoid this?

make a small size dp array …and not store every entries

no no i am asking is there any way where instead of storing some entries we do something different or this is the only way??

No for this problem ,we can do this way only.

In some othrr type of problems we can use bottom up dp to optimise the space, but for this problem this optimisation is the only way

hey @aman212yadav I have one personal question to ask: Have you completed this course and you also had similar doubts like me that’s why you are able to solve my queries very effectively or you have done so much practice yourself that you can easily solve any query??

i havent asked a single doubt when i was taking the course .i always learn things on my own .i have understood the concepts really well and have done so much practice thats why i m able to answer student queries easily.
i guess i have solved 3000+ questions across various platform(like codechef,leetcode,hackerearth , gfg ,codeforces , hackerank , hackerblocks etc).

1 Like

well my username is aman212yadav across all these platform , if u want u can check my profile

1 Like

I want to ask you how did you come up with the size 7001 here??

thats a random number that i used.

u can use any other number just make sure it wont consume much memory

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.