原文: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 t ...

2013-07-03 18:10 1 5026 推荐指数:

查看详情

[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