Backlog·queued
Palindrome Linked List
DifficultyMedium
PatternFast and Slow Pointer
TrackDSA
tl;dr
Given the head of a linked list, your task is to check whether the linked list is a palindrome or not. Return TRUE if the linked list is a palindrome; otherwise, return FALSE.
full write-up
Note
The input linked list prior to the checking process should be identical to the list after the checking process has been completed.
Constraints
Let n be the number of nodes in a linked list.
- 1 ≤
n≤ 500 - 0 ≤
Node.value≤ 9