Mental Model
We want to find how much water can be trapped between bars of different heights after it rains.
Analogy: Imagine a row of buildings with different heights. When it rains, water fills the gaps between buildings but only up to the height of the shortest building on either side.
Height bars: 3 0 2 0 4
Visual: 4 | ↑
3 | ↑ ↑
2 | ↑ ↑ ↑
1 | ↑ ↑ ↑
0 | ↑ ↑ ↑ ↑ ↑
0 1 2 3 4 (indices)