LeetCode11:Container With Most Water

 public int MaxArea(int[] height) {
     int start=0;
            int end=height.Length-1;
        
            int max=0;
            
            while(start<end)
            {
                max=Math.Max(max,Math.Min(height[start],height[end])*(end-start));
                if(height[start]<height[end])
                    start++;
                else
                    end--;
            }
            
            return max;
    }
原文地址:https://www.cnblogs.com/darksied/p/4783863.html