Delete a given node from a singly-linked list. You do not have access to the head of the list. Also, the node to be deleted is not the tail of the linked list.
1→2→3→4
Deleting 2nd node, we get
1→3→4
1→3→4→1
Deleting 3rd node, we get
1→3→1
The first line contains ‘T’ denoting the number of independent test cases.
For each test case the input has three lines:
For each test case, the output has one line with n-1 space-separated integers denoting the elements of the resultant linked list.
2
4
1 2 3 4
3
3
4 5 6
2
1 2 4
4 6
1 <= T <= 100
1 <= n <= 1000
1 <= element <= 105