Problem Statement :
Given a singly Linked List of integers. Return true if the given singly linked list is a palindrome otherwise returns false.
The only line of each test case contains the elements of the singly linked list separated by a single space and terminated by -1. Hence, -1 would never be a list element.
Sample Input:
1→2→3→4→5→6→-1
Sample Output:
false
Approach :
Time Complexity : O(N)
Space Complexity : O(1)