divya interview question

Histogram max area question from leetcode