Trapping Rain Water

#42
Hard
Two Pointers
O(n)
O(1)
Amazon
Facebook
Microsoft
Google
Apple
View on LeetCode

Problem Description

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.