longest palindromic substring recursive solution
问题 I am aware of solutions that uses the bottom up dynamic programing approach to solve this problem in O(n^2). I am specifically looking for a top down dp approach. Is it possible to achieve longest palindromic substring using a recursive solution? Here is what I have tried but it fails for certain cases, but I feel I am almost on the right track. #include <iostream> #include <string> using namespace std; string S; int dp[55][55]; int solve(int x,int y,int val) { if(x>y)return val; int &ret =