# LeetCode84 Largest Rectangle in Histogram

## 描述

Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.

Above is a histogram where width of each bar is 1, given height = [2,1,5,6,2,3].

The largest rectangle is shown in the shaded area, which has area = 10 unit.

## 思路

$Node_2$初始$l_2$值为$1$，由于$Node_1$被弹出栈，那么$Node_2$向左延伸的距离除了本身的$1$以外，还要加上$Node_1$延伸的长度$l_1$。因此$l_2 = 1 + l_1 = 1 + 1 = 2$。