Given bar heights of a histogram, find the largest rectangle area that can be formed using contiguous bars.
6 2 1 5 6 2 3
The bars with heights 5 and 6 form a rectangle of height 5 and width 2, area 10.
10
4 4 4 4 4
All four bars can be used together, giving area 16.
16
5 0 2 0 3 3
The best rectangle uses the last two bars with height 3, area 6.
6