Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Largest Rectangle in a Histogram by Moff
def largest_histogram(h):
result = min(h) * len(h)
for w in range(1, len(h)):
for i in range(len(h) - w + 1):
result = max(result, min(h[i:i + w]) * w)
return result
Nov. 16, 2016
Comments: