Flipkart interview question

largest rectangle in a histogram path sum 3