[LeetCode]11. Container With Most Water
来源:互联网 发布:硕放菜鸟网络招聘 编辑:程序博客网 时间:2024/05/30 19:33
https://leetcode.com/problems/container-with-most-water/
很简单,要读题,就是找两个竖线与横轴包围的最大面积,和trap water不一样。
public class Solution { public int maxArea(int[] nums) { int beg = 0; int end = nums.length - 1; int res = 0; while (beg < end) { res = Math.max(res, (end - beg) * Math.min(nums[end], nums[beg])); if (nums[beg] < nums[end]) { beg++; } else { end--; } } return res; }}
0 0
- LeetCode 11. Container With Most Water
- [LeetCode]11.Container With Most Water
- LeetCode --- 11. Container With Most Water
- LeetCode 11.Container With Most Water
- [Leetcode] 11. Container With Most Water
- [leetcode] 11.Container With Most Water
- 【leetcode】11. Container With Most Water
- [LeetCode]11. Container With Most Water
- 11. Container With Most Water LeetCode
- leetcode 11. Container With Most Water
- leetcode 11.Container With Most Water
- [LeetCode OJ]11. Container With Most Water
- [leetcode] 11. Container With Most Water
- Leetcode 11. Container With Most Water
- leetcode 11.Container With Most Water
- leetcode 11. Container With Most Water
- LeetCode 11. Container With Most Water
- LeetCode *** 11. Container With Most Water
- [置顶] 深入浅出 Map 的实现(HashMap、HashTable、LinkedHashMap、TreeMap)
- C++ 前置与后置“重载运算符”(++i 与 i++)的区别
- 动态编译-反射调用
- 佳佳的魔法照片-ssl 1255
- 关于防APK反编绎查看源代码和获取图片资源
- [LeetCode]11. Container With Most Water
- pyqt4 QDial QSpinBox
- 日期时间格式化
- 浅谈算法和数据结构: 二 基本排序算法
- 局域网时间同步NTP服务架设
- 网络编程--UDP下的Socket
- 不可视索引
- UGUI DOTeen插件
- Android 应用的真正入口 - ZygoteInit.java