码迷,mamicode.com
首页 >  
搜索关键字:refresh    ( 1347个结果
LeetCode – Refresh – Letter Combination of a Phone Number
This is just a combination. Use hashtable to hold the number ==> charsnotes:1. check corner case : input is empty, do not return vector contains empty...
分类:其他好文   时间:2015-03-20 08:03:21    阅读次数:127
LeetCode – Refresh – Largest Number
Corner case: when all the elements are 0. It should return "0", not "00000000".It use string to compare all the numbers. 1 class Solution { 2 public: ...
分类:其他好文   时间:2015-03-20 06:58:14    阅读次数:109
LeetCode – Refresh – Intersection of Two Linked Lists
Find the common length part, then check with two pointers. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 *...
分类:其他好文   时间:2015-03-20 06:57:04    阅读次数:135
LeetCode – Refresh – Insertion Sort List
Do not forget to break the inner loop, when you find the insert position. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * ...
分类:其他好文   时间:2015-03-20 06:56:19    阅读次数:120
LeetCode – Refresh – Jump Game II
Same with Jump Game I. Just need a step parameter and assume there is no "0" value in the array. 1 class Solution { 2 public: 3 int jump(int A[], ...
分类:其他好文   时间:2015-03-20 06:55:43    阅读次数:124
LeetCode – Refresh – Interleaving String
Notes:1. Even s3 is empty string, if s1 and s2 are emtpy, then it should be true.2. Do not mess up the size of label. 1 class Solution { 2 public: 3 ....
分类:其他好文   时间:2015-03-20 06:54:54    阅读次数:115
LeetCode – Refresh – Integer to Roman
Pretty straight forward. 1 class Solution { 2 public: 3 string getRoman(int n, char ten, char five, char one) { 4 string result; 5 ...
分类:其他好文   时间:2015-03-20 06:53:42    阅读次数:124
LeetCode – Refresh – Jump Game
Need a corner case check for only one element [0]. 1 class Solution { 2 public: 3 bool canJump(int A[], int n) { 4 if (n = n-1) return tru...
分类:其他好文   时间:2015-03-20 06:51:03    阅读次数:127
LeetCode – Refresh – Insert Inverval
Similar to merge intervals. But this is easier than merge interval, because every side is kind of "sorted". 1 /** 2 * Definition for an interval. 3 .....
分类:其他好文   时间:2015-03-20 06:50:10    阅读次数:123
LeetCode – Refresh – Generate Parentheses
Nothing fancy, just use recursive. 1 class Solution { 2 public: 3 void getP(vector &result, string current, int left, int right) { 4 if (l...
分类:其他好文   时间:2015-03-20 01:16:21    阅读次数:113
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!