Given height, an elevation map where height[i] is the height of a 1-unit-wide bar at position i, compute how much water it can trap after raining.
Two pointers closing in from both ends, each tracking the tallest wall seen so far on its own side, beats the naive per-column max-left/max-right scan without extra arrays.
Example
Input: height = [0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]
Output: 6