Mental Model
We want to find two lines that hold the most water between them by maximizing the area formed by their heights and the distance between them.
Analogy: Imagine two vertical walls on a beach holding water between them. The water amount depends on the shorter wall and how far apart the walls are.
height array: [1, 8, 6, 2, 5, 4, 8, 3, 7] Positions: 0 1 2 3 4 5 6 7 8 Water container formed between two lines: Line i ↑ ↑ Line j | | | | | | Distance between i and j is width Height is min(height[i], height[j])
