Longest Common Substring — Solution & Editorial
dp[i][j] = common suffix length ending at Ai, Bj: extend on match, reset to 0 otherwise (unlike LCS, no carrying over).
Complexity: O(|A|·|B|)
Watch out: Substring ≠ subsequence: the max(...) carry-over from LCS must NOT be here.