Palindromic string maximum product interview DP question help

Правка en1, от 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

Теги #dynamic programing, maximize, #strings, hard

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский n1e2m3 2019-08-16 06:28:23 724 Initial revision (published)