For the fourth question in contest,
Add to Neighbour and Remove
Here are my two solutions, one got accepted and one gives WA.
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?