Water at index i = min(maxLeft[i], maxRight[i]) − height[i].
When maxL ≤ maxR, the left pointer's limiting boundary is definitely maxL (right wall is taller), so water = maxL − h[L].
We don't need to know the actual min — the smaller side's max IS the bottleneck.
For each bar, you could scan left and right for the tallest walls, which is O(n²). Water above a bar is the smaller of the tallest wall on its left and on its right, minus its own height.
Use two pointers, and keep the tallest wall seen from each side. Whichever side has the lower bar is already decided, because the other side is at least as tall. So settle that side: add its water, and move it inward.
Water at a bar is the smaller of the two tallest walls, minus the bar. With two pointers, the lower side is already decided.
Run the animation above on your own input, or watch the 1:24 video explanation of Trapping Rain Water with a dry run and Java code.