码迷,mamicode.com
首页 >  
搜索关键字:refresh    ( 1347个结果
LeetCode – Refresh – Edit Distance
Still a DP problem.The transition function is not hard to get:1. When s[i-1] == t[j-1], which means we dont have to do any thing to handle the current...
分类:其他好文   时间:2015-03-19 09:52:36    阅读次数:104
LeetCode – Refresh – Dungeon Game
Since it need the min value of initial health, this dp tracks from the back to the start.The trick is either this knight has 1 health or base on next ...
分类:其他好文   时间:2015-03-19 08:51:07    阅读次数:138
LeetCode – Refresh – Distinct Subsequences
This DP is a little bit tricky. You need to clear that:when S[i-1] == T[j-1], it has two part :1. dp[i-1][j-1], this means from 0 - j-1, it already ma...
分类:其他好文   时间:2015-03-19 08:50:24    阅读次数:147
LeetCode – Refresh – Divide Two Integers
There couple of edge cases need to remember:1. The result, absolute value of dividend and divisor. Otherwise, when the record goes out of boundary, th...
分类:其他好文   时间:2015-03-19 08:50:24    阅读次数:125
LeetCode – Refresh – Count and Say
Pretty straight forward. count numbers and put char. 1 class Solution { 2 public: 3 string getNext(string s) { 4 ostringstream oss; 5 ...
分类:其他好文   时间:2015-03-19 07:47:22    阅读次数:129
LeetCode – Refresh – Decode Ways
Simple DP.Scanning from the end. If current is 0, then no ways as "0", but it can be treated as "10", "20". So do another check whether it can has oth...
分类:其他好文   时间:2015-03-19 07:45:43    阅读次数:148
LeetCode – Refresh – Copy List with Random Pointer
Two methods for doing this problem:1. With extra memory, using hashtable:I made a mistake for mapping[runner->random] = mapping[runner]->random. Then ...
分类:其他好文   时间:2015-03-19 07:44:36    阅读次数:132
LeetCode – Refresh – Container With Most Water
The minimum height controls the volumns. So let two runner at two ends start to scan the array. 1 class Solution { 2 public: 3 int maxArea(vector ...
分类:其他好文   时间:2015-03-19 06:21:12    阅读次数:147
LeetCode – Refresh – Convert Sorted Array to Binary Search Tree
It is kind of binary search. Since this is a sorted array, we can treat it as inorder traversal. And we can define the root node for the Tree.So find ...
分类:其他好文   时间:2015-03-19 06:19:48    阅读次数:105
LeetCode – Refresh – Clone Graph
1. Use BFS to search the graph.2. Create a hashtable to record the one to one mapping. 1 /** 2 * Definition for undirected graph. 3 * struct Undirec.....
分类:其他好文   时间:2015-03-19 06:19:16    阅读次数:125
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!