10 lines
303 B
Python
10 lines
303 B
Python
stack = [-1]
|
|
ans = 0
|
|
for i in xrange(len(height)):
|
|
while height[i] < height[stack[-1]]:
|
|
h = height[stack.pop()]
|
|
w = i - stack[-1] - 1
|
|
ans = max(ans, h * w)
|
|
stack.append(i)
|
|
height.pop()
|
|
return ans |