题目
 注意:二维接雨水,有墙的,有线的,着这个属于线的。
 
class Solution {
    public int maxArea(int[] height) {
        if (height.length < 2) {
            return 0;
        }
        int left = 0, right = height.length - 1, res = 0;
        while (left < right) {
            int tmp = (right - left) * Math.min(height[left], height[right]);
            res = Math.max(res, tmp);
            if (height[left] <= height[right]) {
                ++left;
            } else {
                --right;
            }
        }
        return res;
    }
}
                









![buuctf [极客大挑战 2019]Havefun1](https://img-blog.csdnimg.cn/bf054aab036c4912998ccc5ba1fa4f10.png)







