Palindrome Linked List Problem

Palindrome Linked List Problem — ExecCode Easy DSA Practice

Solve the Palindrome Linked List problem on ExecCode. Free online easy DSA practice in Linked List. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the head of a singly linked list, return true if it is apalindromeor false otherwise.

Examples

Input {"values": [1, 2, 3, 2, 1]}; Output True. Input {"values": [1, 2, 3, 4]}; Output False. Input {"values": [1, 2, 2, 1]}; Output True

Constraints

The number of nodes in the list is in the range [1, 10^5]. 0 <= Node.val <= 9

Practice Palindrome Linked List free on ExecCode. Browse DSA problems, topic map, and placement guides.