LinkedIn interview question

Find all palindromic subsequences.

Interview Answer

Anonymous

16 Sept 2017

All Palindromic subsequences // Function return the total palindromic subsequence int countPS(string str) { int N = str.length(); // create a 2D array to store the count of palindromic // subsequence int cps[N+1][N+1]; memset(cps, 0 ,sizeof(cps)); // palindromic subsequence of length 1 for (int i=0; i

1