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 swagg010164
def largest_histogram(a):
answer = 0
for height in range(1, max(a)+1):
carry = 0
for j in range(len(a)):
if a[j] >= height:
carry += 1
else:
answer = max(answer, height*carry)
carry = 0
answer = max(answer, height*carry)
return answer
Dec. 8, 2019
Comments: