1、双指针
- 维护区间信息、子序列匹配、利用序列有序性、单项链表找环
- 双指针 - OI Wiki (oi-wiki.org)
盛最多水的容器
https://leetcode.cn/problems/container-with-most-water/
public class Solution {
public int maxArea(int[] height) {
int l = 0, r = height.length - 1;
int ans = 0;
while (l < r) {
int area = Math.min(height[l], height[r]) * (r - l);
ans = Math.max(ans, area);
if (height[l] <= height[r]) {
++l;
}
else {
--r;
}
}
return ans;
}
}
2、前缀和
参见其他博客:特殊数组—前缀和解法










![[数据集][目标检测]工程机械车辆检测数据集VOC+YOLO格式3189张10类别](https://i-blog.csdnimg.cn/direct/3e6cd846b25148a99f7521686daa0036.png)








![[Algorithm][贪心][跳跃游戏][加油站][单调递增的数字][坏了的计算器]详细讲解](https://i-blog.csdnimg.cn/direct/53e8ddde95b74d5595fdafe30377c4e2.png)