Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
6-liner solution in Clear category for Largest Rectangle in a Histogram by przemyslaw.daniel
def largest_histogram(historgram):
hlen, ret = len(historgram), []
for width in range(1, hlen+1):
for pos in range(hlen-width+1):
ret += [min(historgram[pos:pos+width])*width]
return max(ret)
Nov. 17, 2016
Comments: