Created
February 26, 2020 16:54
-
-
Save deque-blog/b2501242d2115a0f3e3df0d14c8486ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def maxArea(heights: List[int]) -> int: | |
max_area = 0 | |
n = len(heights) | |
for i in range(n): | |
for j in range(i+1, n): | |
width = j - i | |
height = min(heights[i], heights[j]) | |
max_area = max(max_area, width * height) | |
return max_area |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment