Search
⌘K

Leetcode 2484. Count Palindromic Subsequences

Count the number of length-5 palindromic subsequences in a digit string (they must have the form a b c b a) and return the result modulo 1e9+7. The algorithmic challenge is to efficiently count combinations of matching outer and inner digit pairs across positions (e.g., via aggregated prefix/suffix counts or DP) for strings up to ~10^4 in length.

Asked at:

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late April, 2025

Meta

Mid-level

Late January, 2025

Meta

Mid-level

Comments

Your account is free and you can post anonymously if you choose.