give string s return number different nonempty palindromic subsequence s since answer large return modulo 109 7a subsequence string obtain delete zero character stringa sequence palindromic equal sequence reversedTwo sequences a1 a2 b1 b2 different ai bi Example 1input s bccboutput 6explanation the 6 different nonempty palindromic subsequence b c bb cc bcb bccbNote bcb count occur twiceexample 2input s abcdabcdabcdabcdabcdabcdabcdabcddcbadcbadcbadcbadcbadcbadcbadcbaoutput 104860361explanation there 3104860382 different nonempty palindromic subsequence 104860361 modulo 109 7 constraints1 slength 1000si b c d