Palindromic string maximum product interview DP question help

Revision en1, by n1e2m3, 2019-08-16 06:28:23

given a string S. you have to find maximum product of length of two non overlapping palindromic sequence.
here, non overlapping means only indexes are non overlap.

for example,

1)
s = “abcab”
ans = 3*2 = 6
two palindromic sequence are “aca” and “bb”

2 )
s = nriatdoiarn
ans = 5*5 = 25
two palindromic sequences are “nitin” and ( “radar” or “raoar”)

3 )
s = “abcdef”
ans = 1*1 = 1

please share your solution.

Easy Version link : https://stackoverflow.com/questions/53663721/find-the-maximum-product-of-two-non-overlapping-palindromic-subsequences

Tags #dynamic programing, maximize, #strings, hard

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English n1e2m3 2019-08-16 06:28:23 724 Initial revision (published)