Distinct palindromic subsequences
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) -> intExample 1
Input
count_distinct_palindromic_subseq("bccb")Output
6