摘要:
problem:https://leetcode.com/problems/distinct-subsequences/ 字符匹配类型题目。 阅读全文
posted @ 2019-08-09 23:02
fish1996
阅读(126)
评论(0)
推荐(0)
摘要:
problem:https://leetcode.com/problems/wildcard-matching/ 用记忆化搜索做的,不容易出错: 非递归: 阅读全文
posted @ 2019-08-09 22:24
fish1996
阅读(157)
评论(0)
推荐(0)
摘要:
problem:https://leetcode.com/problems/unique-binary-search-trees/ 左子树个数 * 右子树个数 阅读全文
posted @ 2019-08-09 22:00
fish1996
阅读(127)
评论(0)
推荐(0)
摘要:
problem:https://leetcode.com/problems/unique-binary-search-trees-ii/ 用递归传最小值和最大值写起来代码应该会更简练,此处用的是递推写的。 阅读全文
posted @ 2019-08-09 21:49
fish1996
阅读(415)
评论(0)
推荐(0)
摘要:
problem:https://leetcode.com/problems/unique-paths-ii 爬台阶类型问题(2D), 如果当前位置有障碍物就不进行状态转换。 阅读全文
posted @ 2019-08-09 16:28
fish1996
阅读(157)
评论(0)
推荐(0)
摘要:
problem:https://leetcode.com/problems/longest-string-chain/ 爬台阶类型问题。从长度为k转换为长度为k + 1的字符串。此处通过删掉一个字符,查看删掉后的字符串是否存在来判断能否转换。 阅读全文
posted @ 2019-08-09 14:27
fish1996
阅读(393)
评论(0)
推荐(0)
摘要:
problem:https://leetcode.com/problems/partition-equal-subset-sum/ 经典背包问题。找到是否存在恰好装满sum / 2的物体,可以优化为1D的。 阅读全文
posted @ 2019-08-09 12:58
fish1996
阅读(151)
评论(0)
推荐(0)
摘要:
problem:https://leetcode.com/problems/largest-sum-of-averages 爬台阶类型dp。递推考虑的不只是从前i个数字到前i + 1个数字,还需要考虑从划分为k到划分为k + 1组,相当于在后面叠加一组。 记忆搜索做法: dp做法: 滚动数组优化空间 阅读全文
posted @ 2019-08-09 11:33
fish1996
阅读(193)
评论(0)
推荐(0)
摘要:
problem:https://leetcode.com/problems/longest-arithmetic-sequence/description/ 最长子序列类型问题。因为状态比较多,可以存在hash表里,之后直接查找。 阅读全文
posted @ 2019-08-09 00:53
fish1996
阅读(283)
评论(0)
推荐(0)

浙公网安备 33010602011771号