Sample Input
4
1 2 3 4
Sample Output
6
Explanation
Piyush will pick the coin 4. Then Nimit can pick either 1 or 3. In both the cases piyush picks coin 2 and wins with a total of 6.
isn’t this incorrect?
if piyush picks coin 4
then nimit picks coin 1
then piyush can pick coin 3 making a total of 7.