← ALL NOTES
Array

11. Container With Most Water

Brute force checks every pair — O(n²). The shortcut is one property: the water a pair holds is capped by the shorter wall. So start with the two pointers at the ends — the widest possible container —…

Loading…