Create Solution.py

pull/7/head
buaazhangqi 5 years ago committed by GitHub
parent 2be3734ea7
commit 52352fae1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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]<height[end]:
begin+=1
else:
end-=1
return maxValue
Loading…
Cancel
Save