Concept Flow - Trapping Rain Water Problem
Start with height array
Find max height to left for each bar
Find max height to right for each bar
Calculate trapped water at each bar: min(left_max, right_max) - height
Sum all trapped water amounts
Return total trapped water
The flow finds the highest bar on left and right for each position, then calculates trapped water by the difference, summing all.
