{"id":"83548e11-c767-447f-a1e4-b41303e182c5","name":"Count Palindromic Subsequences","description":" 1. You are given a string str.\r\n2. You are required to print the count of palindromic subsequences in string str.\r\n ","inputFormat":"A string str","outputFormat":"A number representing the count of palindromic subsequences in string str.","constraints":"0 <= str.length <= 10","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"hard","sampleInput":"ccbbgd","sampleOutput":"8","questionVideo":"https://www.youtube.com/embed/YHSjvswCXC8?end=31","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"1eb0c918-dde0-452b-860d-48b2f6cd6e47","name":"Count Palindromic Subsequences","slug":"count-palindromic-subsequences","type":1}],"next":{"id":"0f01c6f8-a022-4626-952d-c66ac99393f0","name":"Count Palindromic Substrings","type":1,"slug":"count-palindromic-substrings"},"prev":{"id":"5e7f7a9e-5072-4c7c-9c9a-63f6ddab5032","name":"Maximum Alternating Subsequence Sum","type":3,"slug":"maximum-alternating-subsequence-sum"}}}

Count Palindromic Subsequences

1. You are given a string str. 2. You are required to print the count of palindromic subsequences in string str.

{"id":"83548e11-c767-447f-a1e4-b41303e182c5","name":"Count Palindromic Subsequences","description":" 1. You are given a string str.\r\n2. You are required to print the count of palindromic subsequences in string str.\r\n ","inputFormat":"A string str","outputFormat":"A number representing the count of palindromic subsequences in string str.","constraints":"0 <= str.length <= 10","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"hard","sampleInput":"ccbbgd","sampleOutput":"8","questionVideo":"https://www.youtube.com/embed/YHSjvswCXC8?end=31","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"1eb0c918-dde0-452b-860d-48b2f6cd6e47","name":"Count Palindromic Subsequences","slug":"count-palindromic-subsequences","type":1}],"next":{"id":"0f01c6f8-a022-4626-952d-c66ac99393f0","name":"Count Palindromic Substrings","type":1,"slug":"count-palindromic-substrings"},"prev":{"id":"5e7f7a9e-5072-4c7c-9c9a-63f6ddab5032","name":"Maximum Alternating Subsequence Sum","type":3,"slug":"maximum-alternating-subsequence-sum"}}}
plane

Editor


Loading...

Count Palindromic Subsequences

hard

1. You are given a string str. 2. You are required to print the count of palindromic subsequences in string str.

Constraints

0 <= str.length <= 10

Format

Input

A string str

Output

A number representing the count of palindromic subsequences in string str.

Example

Sample Input

ccbbgd

Sample Output

8

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode