摘要:
标签:动态规划 题目描述: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. Example For example, g 阅读全文
摘要:
标签: 动态规划 解题思路 1. 这道题最重要的是,存在三个字符串,但是并不需要两个二维矩阵来进行解,因为可以使用i+j-1来代表s3的下标,这样就可以通过i和j来遍历s3了。因为对于任何一个合法的交叉字符串都会有,s3(i+j-1)=s1(i-1) 或者s3(i+j-1) = s2(j-1) 2. 阅读全文
摘要:
标签:动态规划 描述: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step 阅读全文
摘要:
标签:动态规划 题目描述: Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is 阅读全文