Mental Model
We want to find how much water can stay trapped between bars after it rains, by looking at the heights around each bar.
Analogy: Imagine a row of buildings with different heights. When it rains, water fills the gaps between taller buildings, but only up to the height of the shortest taller building on either side.
Height bars: 3 0 2 0 4
Visual: 4| ↑
3| ↑ ↑
2| ↑ ↑
1|
0|_ _ _ _ _
Indexes: 0 1 2 3 4