Three test cases failing
Hello @pranjuldwivedi120568 your approach is not correct;
i have explained for test cases like thes in this test case if both the players are playing optimally then the maximum result can be 154.
10
22 50 16 13 8 41 25 43 8 7
Here for your reference i am attaching the code:
can u please help me understand the concept of optimal stratergy for winning the game
@pranjuldwivedi120568 yes sure in the above code as if you have noticed i am chossing the min result and there we are minimising the result of the nimit and maximizing the result of the piyush in the result case.
dry run this code as i have dine but for the small test case you will get it
how we are able to minimise the result of the nimit and maximising of piyush.
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.