why is one test case not passing?
modification required
Optimal game strategy-1
Hi vibhuti
Your logic is inappropriate. Greedy approach will not work here, i.e. picking up the max of first and last element.
You need to think of game playing strategy.
consider example:
8 15 3 7
your ans = piyush : 15, nimit : 18
correct ans = piyush : 22, nimit : 11
Hope it helps:)
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.