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.
A length-5 palindrome has a fixed middle, so pair counts on each side of every middle position combine into the answer.