Tony's Log

Algorithms, Distributed System, Machine Learning

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

2014年8月8日

摘要: No limit to transaction count, so it is a recursive sum calculation. Take care of boundary condition.class Solution {public: int maxProfit(vector &... 阅读全文
posted @ 2014-08-08 14:31 Tonix 阅读(160) 评论(0) 推荐(0)

摘要: Also the very first problem on EPI.class Solution {public: int maxProfit(vector &prices) { size_t len = prices.size(); if (len = pric... 阅读全文
posted @ 2014-08-08 14:20 Tonix 阅读(159) 评论(0) 推荐(0)

摘要: "that are all of the same length" is the key. This statement makes everything much simpler. And, please take care that L may contain duplicated string... 阅读全文
posted @ 2014-08-08 13:54 Tonix 阅读(120) 评论(0) 推荐(0)

摘要: Since it is a "return all" problem, we can use DFS. But brutal DFS got a TLE. So pruning is required.I referred tohttp://fisherlei.blogspot.com/2013/1... 阅读全文
posted @ 2014-08-08 08:09 Tonix 阅读(185) 评论(0) 推荐(0)

摘要: My first solution was DFS - TLE. Apparently, DFS with TLE usually means DP.1D DP + Rolling Array:class Solution {public: bool wordBreak(string s, u... 阅读全文
posted @ 2014-08-08 07:14 Tonix 阅读(182) 评论(0) 推荐(0)