@@ -0,0 +1,515 @@
+class Solution:%0A    # @param A, B: Two string.%0A    # @return: the length of the longest common substring.%0A    def longestCommonSubstring(self, A, B):%0A        # write your code here%0A        m, n = len(A), len(B)%0A        dp = %5B%5B0 for j in range(n + 1)%5D for i in range(m + 1)%5D%0A        mx = 0%0A        for i in range(1, m + 1):%0A            for j in range(1, n + 1):%0A                if A%5Bi - 1%5D == B%5Bj - 1%5D:%0A                    dp%5Bi%5D%5Bj%5D = dp%5Bi - 1%5D%5Bj - 1%5D + 1%0A                    mx = max(mx, dp%5Bi%5D%5Bj%5D)%0A        return mx%0A

Create LngstCmnSubstr_001.py