PythiloHard · 40 min · Task 86 of 100 · progress kept in this browser

Largest histogram rectangle

Return the largest rectangle area under nonnegative unit-width histogram bars in linear time. Empty input returns zero.

height, right, previous_smaller = 5, 4, 1
width = right-previous_smaller-1
print(height*width)
Your task

Return the largest rectangle area under nonnegative unit-width histogram bars in linear time. Empty input returns zero.