Problems > Longest Palindromic Substring > Editorial

Longest Palindromic Substring — Solution & Editorial

Back to the Problem

Expand around each of the 2N−1 centers (odd and even) and record the widest palindrome reached.

Complexity: O(|S|2)