public static int largestRectangleArea(int[] height) {
		if (height == null || height.length == 0) return 0;
		
		int area = 0, len = height.length;
		LinkedList<Integer> stack = new LinkedList<Integer>();

		for (int i = 0; i < len; i ++) {
			if (stack.isEmpty() || height[stack.peek()] <= height[i]) {
				stack.push(i);
			} else {
				int index = stack.pop();
				int high = height[index];
				int width = stack.isEmpty() ? i : i - stack.peek() - 1; 
				area = Math.max(area, high * width);
				i -= 1;
			}
		}
		
		while (!stack.isEmpty()) {
			int index = stack.pop();
			int high = height[index];
			int width = stack.isEmpty() ? len : len - stack.peek() - 1; 
			area = Math.max(area, high * width);
		}
		
		return area;
	}