Winning Strategy

Please help me…i did everything for the problem,
i am not able to understand the reason for wrong answer

The array given is random so in the test cases there could be arrays like

Here as player1 you want to pick 2000 and check if you can win but your code just takes the 1st element.
this will lead to wrong answers as there will be cases where player1 could have won if he would have taken the bigger element in the first try or later as it goes on