Given two sorted linked lists, merge them inplace to produce a singular sorted linked list.
Example:
A: 2→3→7
B: 1→4→5
Resultant list, after merging A and B:
C: 1→2→3→4→5→7
The first line contains ‘T’ denoting the no of independent test cases.
For each test case the input has three lines:
For each test case, a line containing n+m space-separated integers denoting the elements of merged linked list.
2
3 4
1 2 3
2 2 4 5
3 3
2 3 3
1 4 5
1 2 2 2 3 4 5
1 2 3 3 4 5
1 <= T <= 100
1 <= n, m <= 1000
1 <= elements <= 106