题目描述:
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array A = [1,1,1,2,2,3],
Your function should return length = 5, and A is ...
分类:
其他好文 时间:
2014-11-27 16:16:38
阅读次数:
122
给定一系列整数代表在0,1,2,3...坐标点板的高度,求出在任意两个板之间能装水的最大截面积....
分类:
其他好文 时间:
2014-11-27 01:37:22
阅读次数:
190
题意:
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum prof...
分类:
其他好文 时间:
2014-11-27 00:17:48
阅读次数:
227
很明显的2 pointer问题。。。当满足条件的时候后面的指针加,不满足条件的时候前面的指针加,直到满足条件。。。class Solution {public: int lengthOfLongestSubstringTwoDistinct(string s) { int sta...
分类:
其他好文 时间:
2014-11-26 16:10:45
阅读次数:
336
You were given a gift—a talent or askill—that you can use to help empower yourself and eventually empower others.Make the most out of it by touching l...
分类:
其他好文 时间:
2014-11-26 11:01:35
阅读次数:
151
Emuskald considers himself a master of flow algorithms. Now he has completed his most ingenious program yet — it calculates the maximum flow in an undirected graph. The graph consists of n vertices
...
分类:
其他好文 时间:
2014-11-26 01:26:22
阅读次数:
206
The sinking of the RMS Titanic is one of the most infamous shipwrecks in history. On April 15, 1912, during her maiden voyage, the Titanic sank after colliding with an iceberg, killing 1502 out of 22...
分类:
系统相关 时间:
2014-11-25 23:47:39
阅读次数:
365
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
For example,
Given [0,1,0,2,1,0,1,3,2,1,2,1], ...
分类:
移动开发 时间:
2014-11-25 18:42:47
阅读次数:
202
Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.Fo...
分类:
移动开发 时间:
2014-11-25 18:27:58
阅读次数:
156
OverviewView On GithubOne of the most frequently asked features from MEAN users is a way to scaffold their applications. As we looked for a way to hel...
分类:
Web程序 时间:
2014-11-25 18:26:08
阅读次数:
202