For August LunchTime Mix Mix Game(https://www.codechef.com/LTIME63B/problems/JAGAM)

After seeing the editorial explanation, my approach was to find if

- for first turn check if adding or

subtracting of a number leads to z1

or z2- if so, player 1 wins

- for second turn, choose a pair of number from the array, say “a” and

“b”- calculate a+b, a-b, -a+b, -a-b
- check if any one of them is equal to z1 or z2
- if so, then second player wins

- Else tie

Here I have implemented my logic.

Where am I doing wrong?