当前位置:网站首页>【Hot100】11. 盛最多水的容器
【Hot100】11. 盛最多水的容器
2022-06-30 06:47:00 【王六六的IT日常】
11. 盛最多水的容器
中等题
class Solution {
public int maxArea(int[] height) {
int i = 0, j = height.length - 1, res = 0;
while(i < j) {
res = height[i] < height[j] ?
Math.max(res, (j - i) * height[i++]):
Math.max(res, (j - i) * height[j--]);
}
return res;
}
}
边栏推荐
猜你喜欢

RT thread migration to s5p4418 (I): scheduler
![[fuzzy neural network] mobile robot path planning based on Fuzzy Neural Network](/img/39/c9bf235828b6d50e7931876fa4a918.png)
[fuzzy neural network] mobile robot path planning based on Fuzzy Neural Network

基础刷题(一)

Performance comparison of random network, scale-free network, small world network and NS small world matlab simulation

Pay attention to this live broadcast and learn about the path to achieve the dual carbon goal of the energy industry

Traitement d'images 7 - amélioration d'images

0基础转行软件测试,如何实现月薪9.5k+

神经网络入门

gazebo/set_ model_ State topic driving UAV model through posture

Definition and use of ROS topic messages
随机推荐
ROS multi machine
基础刷题(一)
Centos8 install redis
记录一次腾讯测试开发工程师自动化接口测试实践经验
Never forget the original intention, and be lazy if you can: C # operate word files
Gazebo installation, uninstall and upgrade
1.8 - 多级存储
【转】存储器结构、cache、DMA架构分析
1.3 - Code System
RT thread Kernel Implementation (VI): time slice
ROS service communication programming
Set in set (III)
C # - C # process and convert pixeldata of CT images with fo DICOM
IO stream (file class introduction)
Installing googleplay environment on Huawei mobile phones
1.6 - CPU composition
SOC_ AHB_ SD_ IF
ROS program compilation, like no compilation, refers to the execution of the old compiled executable program
First experience of Galaxy Kirin
史上最全一句话木马