从后往前遍历每个字符,然后再反转 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * s1和s2最长公共子序列的长度 * @param s1 string字符串 * @param s2 string字符串 * @return int整型 */ string LCS(string s1, string s2) { // write code here vector<vector<int> > dp(2005,vector<int>(2005,0)); //先对边界进行初...