Optimal game strategy


Plz check

Not able to pass a single testcase

@chiragbaid7,
You can not sort, that would change the relative ordering of coins. You have to play the game with the coin in given order only.

For the above I am able to pass 4 testcases but from your logic https://ide.codingblocks.com/s/214217 only 1

@chiragbaid7,
I don’t think you have understood the problem at all. Firstly, in your program, how are you differentiating whose turn it is to pick up, If it is opponent’s turn, Piyush should not get an increment in score right…??