Mental Model
Imagine bars of different heights and rainwater filling the gaps between them. The water trapped depends on the tallest bars on the left and right sides.
Analogy: Think of a row of buildings with different heights after rain. Water collects in the valleys between taller buildings, just like water trapped between bars.
Height bars: 3 0 2 0 4 Water trapped: _ _ Representation: 3 ↑ 2 ↑ ↑ 1 ↑ ↑ ↑ 0 ↑ ↑ ↑ ↑ ↑ Index: 0 1 2 3 4
