Given a string s, return the number of distinct nonempty palindromic subsequences in s.
Since the answer can be very large, return it modulo
A subsequence of a string is obtained by deleting zero or more characters from the original string without altering the relative order of the remaining characters.
A string is palindromic if it reads the same forwards and backwards.
Two subsequences are considered distinct if their string values are different.
Constraints:
s.length
s[i] is either 'a', 'b', 'c', or 'd'.
Given a string s, return the number of distinct nonempty palindromic subsequences in s.
Since the answer can be very large, return it modulo
A subsequence of a string is obtained by deleting zero or more characters from the original string without altering the relative order of the remaining characters.
A string is palindromic if it reads the same forwards and backwards.
Two subsequences are considered distinct if their string values are different.
Constraints:
s.length
s[i] is either 'a', 'b', 'c', or 'd'.