diff --git a/src/双指针遍历/q11_盛最多水的容器/Solution.py b/src/双指针遍历/q11_盛最多水的容器/Solution.py new file mode 100644 index 0000000..0588c95 --- /dev/null +++ b/src/双指针遍历/q11_盛最多水的容器/Solution.py @@ -0,0 +1,15 @@ +class Solution: + def maxArea(self, height: List[int]) -> int: + if len(height)<2: + return 0 + begin = 0 + end = len(height)-1 + maxValue = 0 + while begin<=end: + maxValue = max((end-begin)*min(height[begin],height[end]),maxValue) + print(maxValue) + if height[begin]