您的位置:首页 > 大数据 > 人工智能

leetcode_11. Container With Most Water ? 待解决

2017-11-26 18:39 253 查看
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 and n is at least 2.

提示:提交代码后,需要用简洁的语言解释一下代码思路~ 谢谢

历史题目和总结见公众号「每日一道算法题」

https://leetcode.com/problems/container-with-most-water/description/

思路
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  leetcode