Given only a pointer to a node to be deleted in a singly linked list. Print the whole Linked List after deletion.
The first line of input contains an element T, denoting the no of test cases. Then T test cases follow. Each test case contains two lines. The first line of each test case contains two integers N denoting the no of elements of the linked list and P denoting the number of the node which is to be deleted (starting from 0) . Then in the next line are N space separated values of the linked list.
The output for each test case will be the space separated elements of the updated linked list.
Example(To be used only for expected output):
1 2 3 4 5
1 3 6 9
1 2 4 5
3 6 9
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.