Codeforces round #690 (Div. 3)

For the fourth question in contest,
Add to Neighbour and Remove
Here are my two solutions, one got accepted and one gives WA.

Solution 1: Wrong Answer
Solution 2: Accepted

There is only small difference between the codes on line 8. Could someone please tell me test case on which it fails or why is it so?

You can check the test case in the wrong answer
It is:
1
2
2 2

1 Like

Oh thank you! I got the mistake. :slight_smile: