public int largestRectangleArea_Prune(int[] height) {

    int max = 0;

    int lastHeight = Integer.MAX_VALUE;

    for (int i = 0 ; i < height.length ; i++) {

      if (i != 0 && height[i] == lastHeight) {
        continue;
      }
      lastHeight = height[i];

      int leftCount = i - 1;
      int rightCount = i + 1;

      int leftNum = 0;
      int rightNum = 0;

      while (leftCount >= 0) {
        if (height[leftCount] >= height[i]) {
          leftCount--;
          leftNum++;
        } else {
          break;
        }
      }

      while (rightCount < height.length) {
        if (height[rightCount] >= height[i]) {
          rightCount++;
          rightNum++;
        } else {
          break;
        }
      }

      int currtMax = (leftNum + rightNum + 1) * height[i];

      System.out.println(i + " " + currtMax);

      if (currtMax > max) {
        max = currtMax;
      }

    }

    return max;
  }