当前位置:网站首页>11. Container With Most Water
11. Container With Most Water
2022-08-03 16:39:00 【51CTO】
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.
The above vertical lines are represented by array [1,8,6,2,5,4,8,3,7]. In this case, the max area of water (blue section) the container can contain is 49.
Example:
Java
边栏推荐
猜你喜欢
node connection mongoose database process
J9货币论:数字经济为全球经济复苏注入力量
组件通信-父传子组件通信
[redis] cache penetration and cache avalanche and cache breakdown solutions
Auto Scaling 弹性伸缩(运维释放人力)
如何使用MATLAB绘制极坐标堆叠柱状图
MATLAB | 七夕节快到了,还不给朋友安排上这个咕呱小青蛙?
leetcode:202. 快乐数
SQL中对 datetime 类型操作
Description of the functional scenario of "collective storage and general governance" in the data center
随机推荐
C专家编程 第3章 分析C语言的声明 3.3 优先级规则
#夏日挑战赛# HarmonyOS 实现一个绘画板
MobileVIT实战:使用MobileVIT实现图像分类
关于oracle表空间在线碎片整理
20. Valid Parentheses
使用deepstream消息发送功能的时候,检测框没有检测标签,No text labels of bboxes displayed with osd for deepstream-test5
黄致绮 荣获第六季完美童模全球总决赛 全国总冠军
测试测试测试
如何使用MATLAB绘制极坐标堆叠柱状图
C专家编程 第3章 分析C语言的声明 3.1 只有编译器才会喜欢的语法
Understand the recommendation system in one article: Outline 02: The link of the recommendation system, from recalling rough sorting, to fine sorting, to rearranging, and finally showing the recommend
我想请问下,我们的数据库是在亚马逊,Dataworks 连不通,怎么办?
可复现、开放科研、跨学科合作:数据驱动下的科研趋势及应用方案
[Unity Starter Plan] Making RubyAdventure01 - Player Creation & Movement
元宇宙系列--Value creation in the metaverse
Kubernetes 笔记 / 任务 / 管理集群 / 用 kubeadm 管理集群 / 配置一个 cgroup 驱动
To participate in sweepstakes, incoming new programmers magazine welfare!
To add digital wings to education, NetEase Yunxin released the overall solution of "Internet + Education"
When mobile applications go overseas, is your "network optimization" holding back?
83. Remove Duplicates from Sorted List