09 2017 档案
摘要:给出字符串S和字符串T,计算S的不同的子序列中T出现的个数。 子序列字符串是原始字符串通过删除一些(或零个)产生的一个新的字符串,并且对剩下的字符的相对位置没有影响。(比如,“ACE”是“ABCDE”的子序列字符串,而“AEC”不是)。 样例 给出S = "rabbbit", T = "rabbit
阅读全文
摘要:dp[i][j]代表以i结尾,长度为j的最小的字串 因为这个数字会很长 所以不能用数字来dp,必须用字符串来dp 注意一下因为是字符串 所以要去掉前导零
阅读全文
摘要:1 class Solution { 2 public: 3 /* 4 * @param A: An integer array 5 * @param queries: The query list 6 * @return: The number of element in the array th
阅读全文
摘要:1 class Solution { 2 public: 3 /* 4 * @param costs: n x 3 cost matrix 5 * @return: An integer, the minimum cost to paint all houses 6 */ 7 const int inf = 0x3f3f3f3f; ...
阅读全文
摘要:ip地址的每个区域值不大于255 且不能有前导零
阅读全文
摘要:dfs会爆栈 可以 bfs或者用栈模拟函数
阅读全文
摘要:1 /** 2 * // This is the interface that allows for creating nested lists. 3 * // You should not implement it, or speculate about its implementation 4 * class NestedInteger { 5 * public: 6...
阅读全文