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 martin_b
def largest_histogram(histogram):
hm = 0
for p in set(histogram):
m = 0
for h in histogram:
if h >= p:
m += p
else:
hm, m = max(hm, m), 0
hm = max(hm, m)
return hm
Nov. 7, 2016