Container with most water
来源:互联网 发布:数据有效性怎么设置 编辑:程序博客网 时间:2024/05/17 06:26
题目比较简单,每次找较小的板往里移,得到的容器的容积最大的就是所求的容积
public class Solution { public static int maxArea(int[] height) { int begin = 0, high, end = height.length - 1; int max = 0; while (end >= begin) { high = height[begin] < height[end] ? height[begin] : height[end]; max = high * (end - begin) > max ? high * (end - begin) : max; if (height[begin] < height[end]) begin++; else end--; } return max; }}
0 0
- Container With Most Water
- Container with most water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- Container With Most Water
- 利用Navicat传输MySql中不同数据库的数据
- log4j日志、反射、枚举、克隆
- 26-网络编程-02-网络编程(网络要素-IP地址)
- 行内元素和块级元素
- 养成一个SQL好习惯
- Container with most water
- EasyUI添加Tab页时content链接方式
- 26-网络编程-03-网络编程(网络要素-端口)
- tomcat8.0在myeclipse下启动出现系统找不到指定文件的解放方法
- AsyncTask执行顺序
- 轻松搞定权限设计1-页面按钮控制(精确到某个用户和某个按钮)
- ListView显示多个的布局
- HTML5的Canvas实现小圆点在屏幕内跑动
- 正则表达式介绍