234. Palindrome Linked List

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

Example 1:

Input: head = [1,2,2,1]
Output: true

Example 2:

Input: head = [1,2]
Output: false

Constraints:

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

--

--

--

Actuary | ML Practitioner | Apply Tomorrow's Technology to Solve Today's Problems

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building an Online Store with Vue CLI — Part 2

15 Example Article Writing Topics (pdf) | B2 First (FCE)

Firebase hooks, my new best friend.

How to deploy Node.js app to Heroku using cli?

JS one-liners 😻

React Native: Basic Syntax and Primitive Types

IOS universal links

Binary Tree Level Order Traversal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yaokun Lin @ MachineLearningQuickNotes

Yaokun Lin @ MachineLearningQuickNotes

Actuary | ML Practitioner | Apply Tomorrow's Technology to Solve Today's Problems

More from Medium

What have you learnt on the completion of your video interview?

Kadane’s Algorithm

LeetCode 217. Contains Duplicate

Leetcode 140. Word Break II — Solution Explanation