Mental Model
We want to find two lines that hold the most water between them by checking pairs from the edges inward.
Analogy: Imagine two people standing at the ends of a riverbank holding a rope. The water they can hold is limited by the shorter person and the distance between them. Moving inward, we try to find a better pair that can hold more water.
height array: [1] [8] [6] [2] [5] [4] [8] [3] [7] indexes: 0 1 2 3 4 5 6 7 8 left pointer ↑ right pointer ↑
