You are given the head of a singly linked list, return true if it is a palindrome or false otherwise.
A palindrome is a sequence that reads the same forward and backward.
Example 1:
Input: head = [1,2,3,2,1]
Output: trueExample 2:
Input: head = [2,2]
Output: trueExample 3:
Input: head = [2,1]
Output: falseConstraints:
1 <= Length of the list <= 100,000.0 <= Node.val <= 9Follow up: Could you do it in O(n) time and O(1) space?