There is an O(n) algorithm for largestRectangleArea