what if namit choose 1 then Prateek will have option to choose between 2 and 3 and he chooses 3 then maximum sum for parteek will be 7 why u have given 6 .should i consider this thing that namit will also choose max . or i am missing something
Regarding explanation
@rsaini9416624750
It is mentioned in the problem statement that both the players play optimally. Nimit will do his best to maximise his own score. Given the array = [ 1, 2 , 3 ] , Nimit sees that his best choice would be to pick 3. So he will pick 3 and not 1.