原文:[LeetCode] Container With Most Water

Givennnon negative integersa ,a , ...,an, where each represents a point at coordinate i,ai .nvertical lines are drawn such that the two endpoints of lineiis at i,ai and i, . Find two lines, which toge ...

2012-10-29 16:57 0 6158 推薦指數:

查看詳情

[leetcode]Container With Most Water @ Python

原題地址:https://oj.leetcode.com/problems/container-with-most-water/ 題意: Given n non-negative integers a1, a2, ..., an, where each represents a point ...

Tue Jun 10 18:46:00 CST 2014 0 3003
Container With Most Water

題意是有個高度數組,就相當於隔板的高度,求數組中任意兩隔板間盛水的最大量。隔板間的距離與較低隔板的高度乘積即為盛水的容量。 int maxArea(vector<int& ...

Wed Sep 05 19:00:00 CST 2012 0 9804
如何裝最多的水? — leetcode 11. Container With Most Water

炎炎夏日,還是呆在空調房里切切題吧。 Container With Most Water,題意其實有點噱頭,簡化下就是,給一個數組,恩,就叫 height 吧,從中任選兩項 i 和 j(i <= j),使得 Math.min(height[i], height[j]) * (j - i ...

Sun Aug 07 21:42:00 CST 2016 1 1722
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM