Hard
Given a string s, return the number of different non-empty palindromic subsequences in s, taken modulo 10^9 + 7. Two subsequences are different if there is some index where they differ.
Input: s = "bccb" Output: 6
Input: s = "abcd" Output: 4
Input: s = "aaa" Output: 3