Using Longest palindromic subsequence


#1

Can we do it as follows,
if(A.length() - LPS(A) <=1)
return 1;
else return 0;

where LPS is the function for finding the longest palindromic subsequence of A.