LCS
@求解两字串最长公共子串问题@brief LCS PROBLEM n^2 solved@string a ' size is m, str b's size is n for i -> 1 to m for j -> 1 to n if a[i] == b[i] dp[i][j] = dp[i-1][j-1] + 1 else dp[i][j] = max(dp[i-1][j], dp[i][j-1])
LIS
@求解字串中的最长上升或不降子序列@brief LIS PROBLEM n^2 solved@string a' size is n, for i-> 1 to n for j -> 1 to i - 1 if a[i] > a[j] dp[i] = max(dp[i], dp[j] + 1);