Maximal Rectangle

O(n^2). Refer to Largest Rectangle in Histogram