0

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!

Codor
  • 17,447
  • 9
  • 29
  • 56
Steve
  • 33
  • 9
  • 2
    The question title is very misleading. Did you check this already? http://en.wikipedia.org/wiki/Longest_common_substring_problem – ale64bit Nov 19 '14 at 02:59
  • I have already tried applying that algorithm, but in this problem I am basically looking for the length of the substring in a more generalized form. – Steve Nov 19 '14 at 16:56

0 Answers0