Given a Linked List, return an array containing the nodes of the list in the same order.
List: 1→3→4→7
Array: [1 3 4 7]
The first line contains ‘T’ denoting the number of independent test cases.
For each test case the input has two lines:
For each test case, the output has one line with space-separated integers.
2
4
1 3 4 7
3
4 5 6
1 3 4 7
4 5 6
1 <= T <= 100
1 <= n <= 1000
1 <= element <= 1000