Search⌘ K
AI Features

Solution: Palindrome Linked List

Solution: Palindrome Linked List checks whether the values in a given linked list read the same forward and backward. Return TRUE or FALSE, while leaving the original list unchanged.

Statement

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.

Note: The original structure of the linked list must remain unchanged before and after the checking process.

Constraints:

Let n be the number of nodes in a linked list.

  • 1≤1 \leq n ≤500\leq 500 ...