class Solution(object):
    def maxArea(self, height):
        """
        :type height: List[int]
        :rtype: int
        """
        
        intSum = len(height)
        if intSum <= 1:
            return False
        maxVol=0
        left=0
        right=intSum-1
        while left < right:
            maxVol=max(maxVol,(right-left)*min(height[left],height[right]))
            if height[left] < height[right]:
                left+=1
            else:
                right-=1
        return maxVol

 

相关文章:

  • 2021-12-26
  • 2021-10-23
  • 2022-03-03
  • 2021-06-10
  • 2021-09-01
  • 2021-08-22
猜你喜欢
  • 2021-05-26
  • 2021-08-03
  • 2021-09-06
  • 2022-02-28
  • 2021-11-21
  • 2022-01-06
相关资源
相似解决方案