Given a singly linked list, return true if it reads the same forwards and backwards, using O(1) extra space (beyond the input). Return a boolean.
Input: An array of node values.
Output: Boolean — true or false.
Input: [1,2,2,1]
Output: true
Explanation: Reads the same both ways.Input: [1,2,3,2,1]
Output: true
Explanation: Odd-length palindrome.Input: [1,2]
Output: false
Explanation: Not a palindrome.0<=n<=10^50<=value<=9