Longest Palindromic Substring
AlgorithmsMediumExtract the longest palindromic substring, highlighting it inside the text sequence.
Alt+Shift+P
Configuration Panel
Complexity Indices
Time ComplexityO(N^2)
Auxiliary SpaceO(1)
Conceptual Overview
Longest Palindromic Substring (LPS) finds the longest contiguous substring inside string S that reads identically forwards and backwards.
Source: CP-Algorithms reference guide