Given a linked list, reverse it.
Input: 1→2→3→4→NULL
Output: 4→3→2→1→NULL
The first line contains an integer ‘T’, denoting the independent number of test cases.
For each test case the input has two lines:
For each test case, a line containing ‘n’ space-separated integers denoting elements of the reversed linked list.
3
4
1 2 3 4
3
3 4 5
4
1 0 1 2
4 3 2 1
5 4 3
2 1 0 1
1 <= T <= 100
1 <= n <= 104
1 <= element <= 105