由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - leetcode一题
相关主题
求OJ container with most water O(n)解法求解。。。
leetcode一道题Data Structure 一题.
leetcode container with most water有疑问的一题
leetcode的container with most water题再出一题
careercup上一题求解..合并arrayC++ online Test 又一题
关于 max overlap interval 的一题G 电面一题
A Google questionQUALCOMM一题
英语理解力太烂: 题目看不懂careercup 150一题。 9.2
相关话题的讨论汇总
话题: container话题: water话题: most话题: lines话题: expected
进入JobHunting版参与讨论
1 (共1页)
f*****t
发帖数: 13
1
Container With Most Water
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). Find two lines, which together
with x-axis forms a container, such that the container contains the most
water.
Note: You may not slant the container.
下面是run完我的function后的一个test case:
Showing the first failed test case.
input output expected
[1,2,4,3] 6 4
不太明白为什么expected应该是4?
x****8
发帖数: 127
2
take 2 and 3, width 2,
2*2 = 4

point
together

【在 f*****t 的大作中提到】
: Container With Most Water
: 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). Find two lines, which together
: with x-axis forms a container, such that the container contains the most
: water.
: Note: You may not slant the container.
: 下面是run完我的function后的一个test case:
: Showing the first failed test case.
: input output expected

f*****t
发帖数: 13
3
谢谢!

【在 x****8 的大作中提到】
: take 2 and 3, width 2,
: 2*2 = 4
:
: point
: together

1 (共1页)
进入JobHunting版参与讨论
相关主题
careercup 150一题。 9.2careercup上一题求解..合并array
为啥careerCup 4里面graph就一题关于 max overlap interval 的一题
看不懂careercup上一题的答案A Google question
估计死在这一题上了。英语理解力太烂: 题目看不懂
求OJ container with most water O(n)解法求解。。。
leetcode一道题Data Structure 一题.
leetcode container with most water有疑问的一题
leetcode的container with most water题再出一题
相关话题的讨论汇总
话题: container话题: water话题: most话题: lines话题: expected