 All Problems
Palindrome Linked List
easy
linked list
two pointers
recursion
amazon
facebook
microsoft
apple

Given the head of a singly linked list, return true if it is a palindrome or false otherwise.

Example 1:

Input: 1 2 2 1
Output: true

Example 2:

Input: 1 2
Output: false

Input format: Single line of space-separated integers.

Output format: true or false.

Run to check your code against the sample cases, or submit to run every case