This is combination of II and III.1. when k >= length, it is totally II.2. when k localMax[j] = max(localMax[j] + diff, globalMax[j-1] + max(0, diff.....
分类:
其他好文 时间:
2015-03-18 07:49:13
阅读次数:
399
This question is pretty straight forward. 1 class Solution { 2 public: 3 string addBinary(string a, string b) { 4 int runnerA = a.size()-1...
分类:
其他好文 时间:
2015-03-18 07:48:23
阅读次数:
132
Same with add binary. You can also skip delete the result pointer. But just return result->next. Depends on the interviewer. 1 /** 2 * Definition for....
分类:
其他好文 时间:
2015-03-18 07:47:51
阅读次数:
114
To be honest, I dont like this problem. This is just an extra layer loop for 3sum. But two mistakes I had made…..1. when skip j, use condition j > i+1...
分类:
其他好文 时间:
2015-03-18 07:47:09
阅读次数:
130
There are three methods to do it:1. recursive(use memory stack): (Time O(n), Space O(logn) 1 /** 2 * Definition for binary tree 3 * struct TreeNode .....
分类:
其他好文 时间:
2015-03-18 07:46:37
阅读次数:
117
For this problem, do not forget to skip the duplicates for i. Usually I will do duplication removal for j and k.Tag it. 1 class Solution { 2 public: 3...
分类:
其他好文 时间:
2015-03-18 07:46:33
阅读次数:
101
III is a kind of I. But it require 2 maximum value. So scan from begin and scan from end to record the maximum value for currrent index.Then scan the ...
分类:
其他好文 时间:
2015-03-18 07:46:13
阅读次数:
134
1 class Solution { 2 public: 3 int maxProfit(vector &prices) { 4 if (prices.size() < 2) return 0; 5 int len = prices.size(), resu...
分类:
其他好文 时间:
2015-03-18 07:45:30
阅读次数:
129
自动刷新其实自动刷新和跳转没啥区别,刷新就是跳转到本地址。
有几种办法,首先是直接在html的标签里添加下面的代码。html代码代码都放在标签里。//每两秒刷新一次//2s后跳转到百度<meta http-equiv="refresh" content="2; url=www.baidu.com"...
分类:
Web程序 时间:
2015-03-13 18:49:59
阅读次数:
144
看源码:Pull-to-Refresh.Rentals-Androidhttps://github.com/Yalantis/Pull-to-Refresh.Rentals-AndroidAndroid-PullToRefreshhttps://github.com/chrisbanes/Andro...
分类:
移动开发 时间:
2015-03-13 18:36:56
阅读次数:
159