会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
stepsma
Powered by
博客园
博客园
|
首页
|
新随笔
|
联系
|
订阅
|
管理
2016年11月17日
Sliding Window Summary 1 (Leetcode 424, Leetcode 340)
摘要: 这两道题很像。都可以用Sliding Window来解。 Leetcode 424: Longest Repeating Character Replacement 要求仅换K次,变成最长同样字符的continuous string,而optimal转换条件是 用string的长度 最多字符出现个数
阅读全文
posted @ 2016-11-17 23:47 stepsma
阅读(179)
评论(0)
推荐(0)
编辑
Unique Binary Search Trees (Leetcode 96)
摘要: 还是两种解法 1.DP: int numTrees(int n) { if(n dp(n+1, 0); dp[0] = 1; for(int i=1; i mp; int numTrees(int n) { if(n == 0 || n == 1) return 1; else if(mp.coun
阅读全文
posted @ 2016-11-17 10:57 stepsma
阅读(79)
评论(0)
推荐(0)
编辑
Combination Sum IV (Leetcode 377)
摘要: 这里上传两种解法: 1. Memorized Search:
阅读全文
posted @ 2016-11-17 09:26 stepsma
阅读(100)
评论(0)
推荐(0)
编辑