Given two strings X = x1,x2,…,xn and Y = y1,y2,…,ym give adynamic programming algorithm to find the length k of the longeststring Z = z1, . . . , zk where Z appears as a substring of X andas a subsequence of Y . Recall, a substring means consecutiveelements.
For example, for the following input:
X = a,b,d,b,a,b,f,g,d
Y = b,e,t,f,d,b,f,a,f,r
then the answer is 4 (since, b, d, b, a is a substring of X andit is also a subsequence of Y). You do not need to output theactual substring, just its length.
(Faster (and correct) in asymptotic O(ยท) notation is worth morecredit.)
(a) Define
PayPal Gateway not configured
PayPal Gateway not configured