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?