摘要:
我的做法:维护一个window,r移动到超出k distinct character限制是更新max,然后移动l使distinct character <=k; 这种做法更新max只发生在超出限制的时候,有可能永远都没有超出限制,所以while loop完了之后要补上一个max的更新 别人非常棒的做 阅读全文
posted @ 2016-12-15 11:41
neverlandly
阅读(210)
评论(0)
推荐(0)
摘要:
Hint: 看了hint之后想到:既然用数组的话,一行一列都是一个element来代表,估计这个element是要用sum了,那么,能不能用sum来代表一行,使它有且只有一种可能,全部是player1完成的/全部是Player2;所以想到了是Player1就+1,是player2就-1,看最后sum 阅读全文
posted @ 2016-12-15 10:59
neverlandly
阅读(389)
评论(0)
推荐(0)
摘要:
Queue method: Array method: 非常聪明 阅读全文
posted @ 2016-12-15 09:54
neverlandly
阅读(397)
评论(0)
推荐(0)
摘要:
Inspired by: https://discuss.leetcode.com/topic/49041/no-depth-variable-no-multiplication Instead of multiplying by depth, add integers multiple times 阅读全文
posted @ 2016-12-15 07:35
neverlandly
阅读(657)
评论(0)
推荐(0)
摘要:
DFS: 阅读全文
posted @ 2016-12-15 06:31
neverlandly
阅读(267)
评论(0)
推荐(0)
摘要:
refer to https://discuss.leetcode.com/topic/36995/share-my-o-n-java-code-with-brief-explanation-and-comments/2 这道题不好从root到leaf一层一层限制subtree取值范围,因为有可能p 阅读全文
posted @ 2016-12-15 05:59
neverlandly
阅读(332)
评论(0)
推荐(0)
摘要:
这道题应该是hard,首先思想上面参考了https://discuss.leetcode.com/topic/32861/3-lines-python-with-explanation-proof I put the smaller half of the numbers on the even i 阅读全文
posted @ 2016-12-15 03:36
neverlandly
阅读(478)
评论(0)
推荐(0)
浙公网安备 33010602011771号