In the given test case,
4
1 2 3 4
Piyush will first pick 4, then the remaining is 1 2 3
now if nimit will pick 1 then remaining is 2 3.
So now piyush can pick 3 and the total would be 7(4+3).
But in test case he is choosing 2 and hence the total is 6 which is smaller than 7!