摘要:
Main reference: http://zhaohongze.com/wordpress/2013/12/10/leetcode-candy/I was confused by the constraint on BOTH sides of an element. Strategy is: s... 阅读全文
摘要:
http://yucoding.blogspot.com/2012/12/leetcode-question-13-binary-tree.htmlUsually for tree problems, it is either recursion or traversal. For this one... 阅读全文
摘要:
I got a DP solution first which is O(n^2). Apparently it is not a optimized one - think about: it is linear value space. There must be O(n) solution.A... 阅读全文