Manacher’s Algorithm: Longest Palindromic Substring

This article will break down Manacher’s algorithm clearly, so that the reader can build a solid mental model. But first, we need to briefly break down the problem at hand — finding the longest palindromic substring.

Longest Palindromic Substring

If just reading the above sub-heading has you nodding your head, you can probably skip forward to the next section. If not, take a look at the below example:

let str = "abbccbbaxxyyxx"

--

--

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
Elizabeth

Software engineer writing about programming, learning, & more. Highly caffeinated. In a committed relationship with the Oxford comma.