Distinct palindromic subsequences

Write codeHard35 minGoogle style

Your task

Given a string s, count the number of distinct non-empty palindromic SUBSEQUENCES in s, modulo 1000000007. Subsequences are distinguished by their character content (equal strings count once), not by index. 1 <= len(s) <= 1000, lowercase letters. Example: 'bccb' has palindromic subsequences b, c, cc, bb, bcb, bccb = 6.

Examples

count_distinct_palindromic_subseq(s: str) -> int
Example 1
Inputcount_distinct_palindromic_subseq("bccb")
Output6