Problem 1147 · Hard

Longest Chunked Palindrome Decomposition

Match the shortest equal prefix and suffix, peel them off as two chunks, and repeat until the middle is left as one chunk.

Open the interactive visualisation