public int MaxArea(int[] height) {int start=0;int end=height.Length-1;int max=0;while(start<end){max=Math.Max(max,Math.Min(height[start],height[end])*(end-start));if(height[start]<height[end])start++;elseend--;}return max;}

转载于:https://www.cnblogs.com/darksied/p/4783863.html

LeetCode11:Container With Most Water相关推荐

  1. 【贪心+双指针】LeetCode 11. Container With Most Water

    LeetCode 11. Container With Most Water Solution1: 参考网址:http://www.cnblogs.com/grandyang/p/4455109.ht ...

  2. Container with most water(盛水最多的容器)

    Container with most water(盛水最多的容器) 简单的证明 如图 题目: 给定 n 个非负整数 a1,a2,-,an,每个数代表坐标中的一个点 (i, ai) .在坐标内画 n ...

  3. Error排错:container runtime network not ready

    概述(问题) 在对K8S集群进行格式化,重新部署后,所有节点都处于NotReady状态.针对K8S状态进行查询,发现问题是:container runtime network not ready.现将 ...

  4. 视觉架构大一统!港中文提出:Container,对CNN、Transformer和MLP-Mixer进行了大一统...

    点击下方卡片,关注"CVer"公众号 AI/CV重磅干货,第一时间送达 转载自:AIWalker 大家好,我是Happy. 前段时间MLP-Mixer提出后,引发了视觉架构圈的一篇 ...

  5. leetcode -eleven:Container With Most Water

    2019独角兽企业重金招聘Python工程师标准>>> Given n non-negative integers a1, a2, ..., an, where each repre ...

  6. C#LeetCode刷题之#11-盛最多水的容器(Container With Most Water)

    问题 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/3615 访问. 给定 n 个非负整数 a1,a2,...,an,每 ...

  7. 【LeetCode】11. Container With Most Water 解题小结

    题目: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, a ...

  8. LeetCode 11.Container With Most Water

    题目: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, a ...

  9. [LeetCode]题解(python):011-Container With Most Water

    题目来源: https://leetcode.com/problems/container-with-most-water/ 题意分析: 给出一个n长度的非0数组,a1,a2,--,an,ai代表在坐 ...

最新文章

  1. php中的extract函数
  2. 算法之动态规划初步(Java版)
  3. 第一章 初始MySQL
  4. 01-Swift 介绍
  5. 数值分析 使用c语言 源码_分析源码,学会正确使用 Java 线程池
  6. ACM - 欧拉函数(内容)
  7. 无法将类型int隐式转换为string_Scala implicit 隐式转换安全驾驶指南
  8. deepin终端启动自安装程序
  9. inventor弧度怎么标注_家里房间太大,WiFi信号覆盖不了怎么办?网件新作:分身术...
  10. Redis 低成本、高可用设计,牛逼!
  11. 基于Flash CS6和AS3.0编写的打企鹅游戏(类打地鼠)
  12. 如何修复损坏的excel文件?
  13. 服务器突然断电文件系统损坏,电脑突然断电造成系统文件损坏该如何修复?(高级篇)...
  14. 系统服务(daemon)
  15. 我不是蓝牙大神,但还是斗胆对蓝牙学习路线给点建议!
  16. N76E003 驱动 UC1705并口屏(8080)
  17. 【网络安全工程师面试合集】—社会工程学到底是什么?
  18. vue.jsv-if 的key值问题
  19. ArcGIS API for JavaScript实现坐标定位
  20. 关于华为P10(Android 8.0系统)出现的一个莫名奇妙的ANR

热门文章

  1. Mac OS X 中的脚本语言应用
  2. 关于高并发,我想告诉你这些!
  3. Spring Boot 发邮件和附件,超实用!
  4. 你这辈子可能都不需要看《计算机程序设计艺术》了!
  5. MYSQL:子查询关键字 ANY/SOME/IN/ALL
  6. 【报错】No match for argument: mysql-community-server Error: Unable to find a match: mysql-community-s
  7. Failure while trying to resolve exception [org.springframework.http.converter.HttpMessageNotWritabl
  8. 如何去除小数点后面多余的0_704密封胶如何使用?怎么样去除多余的704密封胶?...
  9. cdn刷新api_闲话 CDN
  10. 数据中心机房蓄电池培训