This commit is contained in:
2025-09-15 21:12:04 +08:00
commit 3f58f483ff
144 changed files with 5298 additions and 0 deletions

13
greed/11.py Normal file
View File

@@ -0,0 +1,13 @@
from typing import List
class Solution:
def maxArea(self, height: List[int]) -> int:
left, right = 0,len(height)-1
res = 0
while left < right:
res = max(res, (right-left) * min(height[left], height[right]))
if height[left] < height[right]:
left += 1
else:
right -= 1
return res