Link to problem: https://leetcode.com/problems/trapping-rain-water/
Intuition: The water can only fill up the *lowest* edge before it flows over the edge. Therefore the height of the water at a given spot is the minimum of the largest edge to the left and the largest edge to the right; subtract the height of the ground from this. To build the largest edges arrays we pass over the array in both directions keeping track of the max value seen so far.
SOCIAL
----------------------------------------------------------------------------------------------------------------
Patreon: https://www.patreon.com/joshribakoff
Instagram: https://www.instagram.com/joshribakoff/
Twitter: https://twitter.com/joshribakoff
Github: https://github.com/joshribakoff
LinkedIn: https://www.linkedin.com/in/josh-riba...