Optimal game stratergy dry run problem


i commented out my mistake which i faced in this question question and approach of the code i get it but not able to get the answer on pen and paper
pls provide the dry run for one example

Hi @dipeshgupta197
what doubt do u exactly have… i can see u have successfully submitted the code and gained full points… and regarding dry run try to make the recursion tree. it will give u better insight…

1 Like

yahi doubt hein tree nhi banraha hein code bangaya approach samaj aagayi prr dry run nhi hoo paraha hein efficiently thats why i asked to make dry run for above example mujhe recursion mein vaha thodi dikkat hoojaati hein sir jaha multiple time we use function like here we called the function 4 times pls give me the idea to dry run such type of code jaha we use function many times

yrr ab mai dry run kaise btau… video lecture dekhlo sir ne explain kiya hoga… ya youtube pe optimal game strategy search krlo… kafi ache ache dry runs miljenge vha…

i complete dry run on my own and get the answer correctly now
pls check with the help of call stack i did
https://drive.google.com/file/d/1xpzMA2H1fHjtv8Chu__jPOvpYAu9GnOx/view?usp=sharing
pls check this once

try to make a recursion tree… that will help u better understand the problem… rest ur call stack approach also seems fine…

i hope its clear now… shall i mark the doubt as resolved??

1 Like

yes sir mark it as resolved

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.