会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Tony's Log
Algorithms, Distributed System, Machine Learning
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
::
公告
2014年8月3日
LeetCode "Minimum Path Sum" - 2D DP
摘要: An intuitive 2D DP: dp[i][j] = min(grid[i-1][j-1] + dp[i-1][j], grid[i-1][j-1] + dp[i][j+1])class Solution {public: int minPathSum(vector > &grid) ...
阅读全文
posted @ 2014-08-03 07:30 Tonix
阅读(195)
评论(0)
推荐(0)
LeetCode "Remove Duplicates from Sorted List II"
摘要: Corner cases!class Solution {public: ListNode *deleteDuplicates(ListNode *head) { if (!head) return head; if (!head->next) return hea...
阅读全文
posted @ 2014-08-03 07:04 Tonix
阅读(174)
评论(0)
推荐(0)
LeetCode "Partition List"
摘要: Nothing special. A typical list manipulation problem.class Solution {public: ListNode *partition(ListNode *head, int x) { if (!head) return ...
阅读全文
posted @ 2014-08-03 06:39 Tonix
阅读(132)
评论(0)
推荐(0)