The first line contains a single integer T, denoting the number of test cases. The first line of each test case contains a Linked list of length N separated by space and terminated by -1. The second and last line contains an element that has to be removed from the linked list.
The first and only line of each test case in the output contains the linked list after deleting the required element.
You are not required to print the expected output; it has already been taken care of. Just implement the function. If there are multiple nodes with the given value remove just the first one.
1 <= T <= 5 1 <= N <= 10^5 -10^5 <= arr[i] <= 10^5 Time Limit: 1 sec
Insertion In A Singly Linked List
Deletion In Doubly Linked List
Insertion In Doubly Linked List