there's two methods to resolve the problem:
1) divide and conquer, plus segment tree
2) calcalate the area with each bar as the smallest bar in the area, pick the max, require careful design with a stack