[Leetcode] Container With Most Water
来源:互联网 发布:vb 多线程实例代码 编辑:程序博客网 时间:2024/05/29 14:21
思路来自转载:
http://www.cnblogs.com/remlostime/archive/2012/10/29/2745018.html
public static int maxArea(int[] height) { int max_area = 0; if (height == null || height.length <= 1) { return 0; } int left = 0; int right = height.length - 1; while (left < right) { int h = height[left] < height[right] ? height[left] : height[right]; int area = (right - left) * h; max_area = area > max_area ? area : max_area; if (height[left] > height[right]) { right--; } else { left++; } } return max_area; }
0 0
- LeetCode: Container With Most Water
- [LeetCode]Container With Most Water
- LeetCode Container With Most Water
- LeetCode: Container With Most Water
- [Leetcode] Container With Most Water
- Leetcode: Container With Most Water
- [LeetCode] Container With Most Water
- LeetCode Container With Most Water
- [Leetcode] Container With Most Water
- [LeetCode]Container With Most Water
- LeetCode-Container With Most Water
- Container With Most Water leetcode
- LeetCode - Container With Most Water
- LeetCode: Container With Most Water
- Leetcode: Container With Most Water
- 【LeetCode】Container With Most Water
- Leetcode: Container With Most Water
- LeetCode:Container With Most Water
- V8 之旅:对象表示
- MySQL建表,主键,外键
- svn clean
- 黑马程序员-Java基础学习之银行业务调度系统
- MySQL连接数据库:C API代码, Linux,Windows
- [Leetcode] Container With Most Water
- C++:类和对象
- saltstack--sls文件
- 最新Android & iOS设计尺寸规范
- cookie深度解析
- 广告中的AdNetwork、AdExchange、DSP、SSP、RTB和DMP是什么?
- Activity的四种启动模式和onNewIntent()
- 由浅入深探究mysql索引结构原理、性能分析与优化
- iOS 9适配须知