Given a singly linked list of size N of integers. The task is to check if the given linked list is palindrome or not.
First line of input contains number of testcases T. For each testcase, first line of input contains length of linked list N and next line contains N integers as data of linked list.
For each test case output will be 1 if the linked list is a palindrome else 0.
The task is to complete the function isPalindrome() which takes head as reference as the only parameter and returns true or false if linked list is palindrome or not respectively.
1 <= T <= 103
1 <= N <= 50
Example(To be used only for expected output):
1 2 1
1 2 3 4
Testcase 1: 1 2 1, linked list is palindrome.