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 PiotrStachowiak
def largest_histogram(histogram):
listasum=[]
if len(histogram)==1:
listasum=histogram
else:
for i in range(0,len(histogram)):
for j in range(i,len(histogram)):
lista=[]
for k in range(i,j+1):
lista.append(histogram[k])
a = min(lista)*(j-i+1)
listasum.append(a)
return max(listasum)
Nov. 18, 2016