Help in a string problem.

Revision en1, by 444iq, 2019-10-25 10:52:54

How to approach this problem. My approach was to find the prfix from 0 to i and suffix from n — 1 to i + 1. concatenate both for a new string and find longest palindromic subsequence for the current string. But it gave wrong answer and later I realized that my approach will not work always.

Any other approach for this problem.

Thanks.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English 444iq 2019-10-25 11:04:08 32 Tiny change: ' problem. \n\nThanks' -> ' problem. The tag was dp for the problem.\n\nThanks'
en1 English 444iq 2019-10-25 10:52:54 454 Initial revision (published)