Count Of Distinct Palindromic Subsequences

1. You are given a string.
2. You have to print the count of distinct and non-empty palindromic subsequences in the given string.
3. Two sequences s1 and s2 are distinct if here is some i, for which ith character in s1 and s2 are different.

Note -> String contains only lowercase letters.
-> The answer will be in the integer range only.
Input Format
A String
Output Format
An Integer
Question Video
1 <= length of string <= 10000
Sample Input
Sample Output

  • Asked in Companies
  • Related Topics

Video Solution

Code Solution

Id Name