Given two strings, find the longest common substring.
Return the length of it.
The characters in substring should occur continiously in original string. This is different with subsequnce.
Understand the problem: In computer science, the longest common substring problem is to find the longest string (or strings) that is a substring (or are substrings) of two or more strings. For example, ABCD, and EBCA, the LCS is BC, which has the length of 2.
A DP Solution:
Definition: dp[A.length() + 1][B.length() + 1] , where as dp[i][j] means the LCS ended with i and j