Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You may ...
分类:
其他好文 时间:
2015-01-04 17:14:20
阅读次数:
130
Ananagrams
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
Submit Status
Description
Ananagrams
Most crossword puzzle fans are used to...
分类:
编程语言 时间:
2015-01-03 17:27:43
阅读次数:
231
Xiangqi is one of the most popular two-player board games in China. The game represents a battle between two armies with the goal of capturing the ene...
分类:
其他好文 时间:
2015-01-03 17:19:23
阅读次数:
440
Container With Most WaterGivennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such t...
分类:
其他好文 时间:
2015-01-03 15:52:26
阅读次数:
129
You are given a binary array with N elements: d[0], d[1], ... d[N - 1]. You can perform AT MOST one move on the array: choose any two integers [L, R],...
分类:
其他好文 时间:
2015-01-03 07:05:32
阅读次数:
298
https://oj.leetcode.com/problems/container-with-most-water/http://fisherlei.blogspot.com/2013/01/leetcode-container-with-most-water.htmlpublicclassSolution{
publicintmaxArea(int[]height){
//SolutionB:
//returnmaxArea_BruteForce(height);
//SolutionA:
retur..
分类:
其他好文 时间:
2015-01-02 16:15:22
阅读次数:
158
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) and (i,
0). Fin...
分类:
其他好文 时间:
2014-12-31 20:13:44
阅读次数:
165
rocksCluster 执行# rocks sync users后出现下面的报警信息,会在所有终端出现,影响工作。Message from syslogd@hadoop-9 at Dec 31 16:34:14 ... aceback (most recent call last):Message...
分类:
其他好文 时间:
2014-12-31 18:02:29
阅读次数:
1055
poj 2886 Who Gets the Most Candies?
Description
N children are sitting in a circle to play a game.
The children are numbered from 1 to N in clockwise order. Each of them has a card with ...
分类:
其他好文 时间:
2014-12-30 23:42:05
阅读次数:
310
问题描述:
Say you have an array for which the ith element is the price of a given stock on day
i.
Design an algorithm to find the maximum profit. You may complete at most
two transactions.
Note:
Y...
分类:
其他好文 时间:
2014-12-30 22:08:07
阅读次数:
178