Palindrome Linked List
Given a singly linked list node
whose values are integers, determine whether the linked list forms a palindrome.
Constraints
n ≤ 100,000
wheren
is the length ofnode
https://binarysearch.com/problems/Palindrome-Linked-List
Examples
Example 1
Input
- node =
Output
- answer =
True
Explanation
5 -> 3 -> 5 is a palindrome.
Example 2
Input
- node =
Output
- answer =
True
Explanation
The values of the linked list are the same forwards and backwards.
Leave a comment