会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Tony's Log
Algorithms, Distributed System, Machine Learning
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
::
公告
2015年8月22日
LeetCode "Shortest Word Distance II"
摘要: Simply store indices in ctor.class WordDistance { unordered_map> hm;public: WordDistance(vector& words) { for (int i = 0; i &vec1 = hm[w...
阅读全文
posted @ 2015-08-22 11:18 Tonix
阅读(180)
评论(0)
推荐(0)
LeetCode "Flatten 2D Vector"
摘要: Just take care of corner cases..class Vector2D { vector> &r; int i, i0;public: Vector2D(vector>& vec2d) : r(vec2d), i(0), i0(0) { i...
阅读全文
posted @ 2015-08-22 10:59 Tonix
阅读(183)
评论(0)
推荐(0)
LeetCode "Meeting Rooms II"
摘要: Linear scan after sorting. Please note sorting detail.typedef std::pair Rec;class Solution {public: int minMeetingRooms(vector& intervals) { ...
阅读全文
posted @ 2015-08-22 10:37 Tonix
阅读(186)
评论(0)
推荐(0)
LeetCode "Paint House"
摘要: A typical DPclass Solution {public: int minCost(vector>& costs) { size_t len = costs.size(); if(len == 0) return 0; ve...
阅读全文
posted @ 2015-08-22 00:46 Tonix
阅读(179)
评论(0)
推荐(0)