Histogram Problem

How to solve this problem?

Hi Siddharth,
In this question you have to traverse all bars from left to right, and maintain a stack of bars. Every bar is pushed to stack once. You have to pop a bar from stack when a bar of smaller height is seen. When a bar is popped, you have to calculate the area with the popped bar as smallest bar.

I’ve seen your same reply and it’s not helping, that’s why I’ve raised my doubt.
I know the concept of pushing and popping but the only thing is that how are we calculating the area?