{"id":"274dcb8e-0390-4c06-abfe-a79f3b9ea4d5","name":"Count Palindromic Substrings","description":"1. You are given a string str.\r\n2. You are required to print the count of palindromic substrings in string str.","inputFormat":"A string str","outputFormat":"A number representing the count of palindromic substrings 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":"medium","sampleInput":"abccbc","sampleOutput":"9","questionVideo":"https://www.youtube.com/embed/XmSOWnL6T_I?end=207","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":"0f01c6f8-a022-4626-952d-c66ac99393f0","name":"Count Palindromic Substrings","slug":"count-palindromic-substrings","type":1}],"next":{"id":"a7c4671c-eeb5-4df7-8e71-12d73cfbbf83","name":"Count Of Valleys And Mountains","type":1,"slug":"count-of-valleys-and-mountains"},"prev":{"id":"1eb0c918-dde0-452b-860d-48b2f6cd6e47","name":"Count Palindromic Subsequences","type":1,"slug":"count-palindromic-subsequences"}}}

Count Palindromic Substrings

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

{"id":"274dcb8e-0390-4c06-abfe-a79f3b9ea4d5","name":"Count Palindromic Substrings","description":"1. You are given a string str.\r\n2. You are required to print the count of palindromic substrings in string str.","inputFormat":"A string str","outputFormat":"A number representing the count of palindromic substrings 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":"medium","sampleInput":"abccbc","sampleOutput":"9","questionVideo":"https://www.youtube.com/embed/XmSOWnL6T_I?end=207","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":"0f01c6f8-a022-4626-952d-c66ac99393f0","name":"Count Palindromic Substrings","slug":"count-palindromic-substrings","type":1}],"next":{"id":"a7c4671c-eeb5-4df7-8e71-12d73cfbbf83","name":"Count Of Valleys And Mountains","type":1,"slug":"count-of-valleys-and-mountains"},"prev":{"id":"1eb0c918-dde0-452b-860d-48b2f6cd6e47","name":"Count Palindromic Subsequences","type":1,"slug":"count-palindromic-subsequences"}}}
plane

Editor


Loading...

Count Palindromic Substrings

medium

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

Constraints

0 <= str.length <= 10

Format

Input

A string str

Output

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

Example

Sample Input

abccbc

Sample Output

9

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode