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 Palindromic Subsequence in a given String in C++
In this tutorial, we will be discussing a program to find the number of all palindromic subsequences in a given string.
For this we will be provided with a string. Our task is to find the number of palindromic subsequences that can be made in that given string.
Example
#include#include using namespace std; //returning total palindromic sequence int count_palin(string str){ int N = str.length(); //creating a 2D array int cps[N+1][N+1]; memset(cps, 0 ,sizeof(cps)); for (int i=0; i Output
Total palindromic subsequence are : 6
Advertisements
