The question "water container" is not so clearly marked as the largest rectangle, but I am asked about water in an interview.
The water container basically asks for the area of the largest “valley” between the bars on the histogram. Looking at the histogram in the example with the largest rectangle, the answer will be “1”, because there are two depressions made by the graph, the left side is 1x1 and the left side is 1x1 on the right side. Their maximum, of course, is 1.
source share