Given n non-negative integers representing heights of vertical lines, find two lines that together with the x-axis form a container that holds the most water.
Greedy two-pointer approach: start with widest container (left=0, right=end). Move the shorter line inward — because moving the taller line can only decrease or maintain area.
Time: O(n), Space: O(1) — much better than O(n²) brute force!
max_area([1,8,6,2,5,4,8,3,7])
49