Build the PrimitiveHard
Trapping Rain Water
Write `trap(heights)` returning the total units of water trapped between the bars after rain.
trap([0,1,0,2,1,0,1,3,2,1,2,1]) -> 6
Water above any bar is `min(max_left, max_right) - height`. Precomputing both running maxima into arrays is the honest first answer and costs O(n) space. The two-pointer version keeps only the two maxima and moves whichever side is currently shorter — because that side is the one whose answer is already determined.
What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.