You're an industrious programmer that lives off the grid. The local well that you use to fetch water has gone dry, so you've decided to collect rain water to fill it; however, your collection device isn't flat.
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water your collection device is able to trap after raining occurs.