最长公共子串 题目描述给定两个字符串str1和str2,输出两个字符串的最长公共子串,如果最长公共子串为空,输出-1。示例1输入"1AB2345CD","12345EF"返回值"2345" 这条题目被归类为动态规划,于是我使用动态规划的思路写了一个算法: /** * longest common substring * 动态规划算法 * dp[i][j]有两个分支 * 1. str1[i] = str2[j] dp[i][j] = dp[i][j] + 1 * 2. str1[i] != str2[j] dp[i][j] = Mat...