Given a linked list, find the xth node from the end.
Linked list: 1→2→3→4
x: 2
Result: 3
The first line contains an integer ‘T’ denoting the number of independent test cases.
For each test case the input has three lines:
For each test case, an integer denoting the element to be found.
2
3
3 4 5
2
3
1 2 3
1
4
3
1 <= T <= 100
1 <= x <= n <= 104
1 <= element <= 1000