Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Count all Palindrome Sub-Strings in a String in C++
In this tutorial, we will be discussing a program to find the number of palindrome sub strings in a string.
For this we will be given a string. Our task is to count the number of palindrome sub strings in the given string with length greater than 3.
Example
#includeusing namespace std; //counting palindrome strings int count_pstr(char str[], int n){ int dp[n][n]; memset(dp, 0, sizeof(dp)); bool P[n][n]; memset(P, false , sizeof(P)); for (int i= 0; i Output
3
Advertisements
