longest common substring for two strings

327 views Asked by At

I am looking to find the substring of two different strings; the problem is as follows:

Given two strings x = X1...Xn and y = Y1...Ym, find the length of the longest common substring, and the largest k for which in the indices i and j with XiXi+1...Xi+k-1 = YjYj+1...Yj+k-1. Show how to do this in time O(m*n).

Can someone help me with this problem I've been looking at it for too long? I have already tried doing the subspace for this problem, but ended up getting it wrong. Any assistance would be gladly appreciated! Thank you in advance!

0

There are 0 answers