原文:Container With Most Water

题意是有个高度数组,就相当于隔板的高度,求数组中任意两隔板间盛水的最大量。隔板间的距离与较低隔板的高度乘积即为盛水的容量。 int maxArea vector lt int gt amp height int capability size t left , right height.size while left lt right const int water min height lef ...

2012-09-05 11:00 0 9804 推荐指数:

查看详情

[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
刷题11. Container With Most Water

一、题目说明 11.Container With Most Water,这个题目难度是Medium。 二、我的做法 乍一看,简单啊,两个for循环就可以了,我在本地写的。 提交后运行,居然Time Limit Exceeded是,好伤心。 里面给了一个非常长的数据,实际上我本地 ...

Tue Jan 28 15:26:00 CST 2020 0 2289
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM