Problem 730 · Hard

Count Different Palindromic Subsequences

Interval DP: equal ends multiply the inner count, corrected by palindromes repeated at the nearest matching letters.

Open the interactive visualisation