Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2014年8月6日

摘要: I think it is natural for an algorithm rookie that when facing a challenging problem, a rookie may fall into her\his algorithm dictionary - she focuse... 阅读全文
posted @ 2014-08-06 13:51 Tonix 阅读(152) 评论(0) 推荐(0)

摘要: Your intuition would tell you that there's a O(n) solution. Actually it is another stack-based problem to solve.class Solution {public: struct Rec ... 阅读全文
posted @ 2014-08-06 13:40 Tonix 阅读(153) 评论(0) 推荐(0)

摘要: It took me +20 submissions to get AC... Actually the statement is too vague. I would rather ask for requirements f2f.Apparently the code below can be ... 阅读全文
posted @ 2014-08-06 07:39 Tonix 阅读(138) 评论(0) 推荐(0)

摘要: 2D DP is an intuitive solution of course, but I got an MLE error, so I simplified it into a 1D DP:class Solution {public: void goDp(vector &dp, int... 阅读全文
posted @ 2014-08-06 05:56 Tonix 阅读(162) 评论(0) 推荐(0)

摘要: Another list manipulation problem.class Solution {public: ListNode *reverseKGroup(ListNode *head, int k) { if (!head) return head; if... 阅读全文
posted @ 2014-08-06 04:46 Tonix 阅读(158) 评论(0) 推荐(0)