Given a non-negative number represented as a linked list, determine whether it is a palindrome or not.
Number : 1234
Linked list : 1→2→3→4
Result : Not a palindrome
Number : 1221
Linked list : 1→2→2→1
Result : A palindrome
The first line contains ‘T’, denoting the number of test cases.
For each test case the input has two lines:
For each test case, the output has one line with 1 if the number is a palindrome, 0 otherwise.
4
4
3 4 5 3
5
1 2 3 2 1
3
3 1 3
4
1 4 4 1
0
1
1
1
1 <= T <= 100
1 <= n <= 104
0 <= nodeValue <= 9