标签:def end span color 容器 col div ret int
class Solution(object): def maxArea(self, height): """ :type height: List[int] :rtype: int """ h_len = len(height) i = 0 k = -1 s = [] while h_len + k - i >= 1: s.append(min(height[i], height[k]) * (h_len + k - i)) if height[i] <= height[k]: i += 1 else: k -= 1 return max(s)
# 测试用例
"""
输入: [1,8,6,2,5,4,8,3,7] 输出: 49
"""
标签:def end span color 容器 col div ret int
原文地址:https://www.cnblogs.com/xiao-xue-di/p/10292153.html