public int largestRectangleArea(int[] height) {
        int maxArea = 0;
        int n = height.length;
        for( int i = 0; i < n; i++ ) {
            if( i < n - 1 && height[i] <= height[i+1] ) continue;
            int maxHeight = height[i];
            for( int j = i; j >= 0; j-- ) {
                int l = i - j + 1;
                maxHeight = Math.min( height[j], maxHeight );
                maxArea = Math.max( maxArea, maxHeight * l );
            }
        }
        return maxArea;
    }