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
We will traverse the linked list from the head node till we find the node that has to be removed, and upon getting that, we remove it and return the linked list.
The steps are as follows:
Deletion In Doubly Linked List
Insertion In Doubly Linked List
LRU Cache
Delete Nodes On Regular Intervals
Add One To Linked List