盛最多水的容器 题目 思路 矮就换,过一遍。 代码 class Solution { public: int maxArea(vector<int>& height) { int ma=0; int l=0,r=height.size()-1; while(l<r) { int mi=height[l]<height[r]?height[l++]:height[r--]; ma=max(ma,(r-l+1)*mi); } return ma; } };