49. Palindrome Linked List

Given the head of a singly linked list head. Return true if the list is a palindrome, otherwise false.
Example 1
Input: head = [1,2,2,1]
Output: True
Explanation: The list reads the same left to right and right to left.
Example 2
Input: head = [1,2]
Output: False
Explanation: Values at symmetric positions do not match.
easylinked list
JavaScript
Loading...
Line 1, Char 1