2015年4月1日
摘要: From Here For each node, 4 conditions: 1. Node only (因为本题中的节点可能是负值!) 2. L-sub + Node 3. R-sub + Node 4. L-sub + Node + R-sub (in here the max ... 阅读全文
posted @ 2015-04-01 13:37 Seth_L 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 懒得自己写了。。代码这里来的:点击总体来讲就是先按照x来sort,x一样sort y, 然后比较前面的y和后面的xpublic ArrayList merge(ArrayList intervals) { ArrayList res = new ArrayList(); ... 阅读全文
posted @ 2015-04-01 13:29 Seth_L 阅读(83) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public ListNode mergeKLists(List lists) { if(lists == null || lists.size() == 0) { return null; ... 阅读全文
posted @ 2015-04-01 13:13 Seth_L 阅读(227) 评论(0) 推荐(0) 编辑
摘要: From Here Solution: Remember that a line can be represented by y=kx+d, if p1 and p2 are in same line, then y1=x1k+d, y2=kx2+d, so y2-y1=k... 阅读全文
posted @ 2015-04-01 12:28 Seth_L 阅读(167) 评论(0) 推荐(0) 编辑
摘要: From Here public static String FindAndReplace(String GivenString, String Pattern, String ReplaceString) { int j = 0; ... 阅读全文
posted @ 2015-04-01 12:07 Seth_L 阅读(108) 评论(0) 推荐(0) 编辑