原文:[leetcode]Container With Most Water @ Python

原題地址:https: oj.leetcode.com problems 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 t ...

2014-06-10 10:46 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