<prompt> Write a function to find the longest common substring of two strings.  <response>: Heres a Python function that you can use to find the longest common substring of two strings:pythondef longest_common_substringstring1, string2: m lenstring1 n lenstring2 Create a table to store lengths of longest common suffixes of substrings maxLength 0 end 0 length 0 for j in rangen 1 for i in rangem 1 Find the common substrings for i in range1, m 1: for j in range1, n 1: if string1i - 1 string2j - 1: lengthij lengthi - 1j - 1 1 update the maximum length and result index if maxLength lengthij: maxLength lengthij end i - 1 else: lengthij 0 return the longest common substring return string1end - maxLength 1:end 1Heres an example of how you can use this function:pythonstring1 abcdefabcdefgstring2 xyzabcdefwabclongest_common longest_common_substringstring1, string2printlongest_common abcdef 