Problem 2484 · Hard

Count Palindromic Subsequences

A length-5 palindrome has a fixed middle, so pair counts on each side of every middle position combine into the answer.

Open the interactive visualisation