First-line contains ‘T’, denoting the number of Test cases.
For each Test case:
The first line contains an integer, ‘N’.
The following line contains ‘N + 1’ space-separated integers, which are the nodes of the first LinkedList, and each line ends with -1 to indicate that the LinkedList is over. Thus, -1 will never be a LinkedList element.
The following line contains ‘N + 1’ space-separated integers, which are the nodes of the second LinkedList, and each line ends with -1 to indicate that the LinkedList is over. Thus, -1 will never be a LinkedList element.
For each test case, you have to print the modified first LinkedList,
You don’t need to print or return anything. Just implement the given function and modify the first LinkedList.
1 <= ‘T’ <= 10
1 <= ‘N’ <= 10^5
All the elements in both of the LinkedList lie in the range [-10^9, 10^9] - {1}.
Note- the sum of ‘N’ over all test cases does not exceed 10^5.
Time Limit: 1 sec
Algorithm:
Deletion In Doubly Linked List
Deletion In Doubly Linked List
Deletion In Doubly Linked List
Insertion In Doubly Linked List
Insertion In Doubly Linked List
Insertion In Doubly Linked List
Insertion In Doubly Linked List
LRU Cache
Delete Nodes On Regular Intervals
Add One To Linked List