public int largestRectangleArea(int[] height) {
		if(height == null || height.length == 0) return 0;
		Stack<Integer> stack = new Stack<Integer>();
		int max = 0, res = 0, i = 0;
		
		while(i <= height.length) {
			if(stack.isEmpty() || (i < height.length && height[i] >= height[stack.peek()])) 
				stack.add(i++);
			else {
				res = height[stack.pop()];
				res *= (stack.isEmpty() ? i : (i - 1 - stack.peek()));
				if(res > max) max = res;
			}
		}
		return max;
	}