Thin walls with space between — water fills the gap. Find the biggest container.
Buildings touching — no gaps. Water trapped on top of each building between taller ones.
Bars touching — no gaps. Extend each bar left/right to find the largest rectangle.