Problem 1682 · Medium

Longest Palindromic Subsequence II

Layer matching pairs from the outside in; each layer letter must differ from the layer outside it.

Open the interactive visualisation