public int largestRectangleArea(int[] height) {
		if (height.length == 0)
			return 0;

		int maxArea = height[0];
		Stack<Integer> stack = new Stack<Integer>();
		int[] h = Arrays.copyOf(height, height.length + 1);
		int i = 0;
		while (i < h.length) {
			if (stack.isEmpty() || h[i] >= h[stack.peek()]) {
				stack.push(i++);
			} else {
				int temp = stack.pop();
				maxArea = Math.max(maxArea, h[temp]
						* (stack.isEmpty() ? i : i - stack.peek() - 1));
			}
		}

		return maxArea;
	}