Google | Phone Screen | Trapping Rain Water
Anonymous User
1385

https://leetcode.com/problems/trapping-rain-water/


Follow-up:
What if now water is not coming from sky, instead we choose an index to pour x unit of water, what is the amount of water we can trap now?

Example

Input: [2, 0, 0, 4, 0, 1]
Output: 4
Explanation: if we pour 4 unit at index 2, max it can trap 4 unit of water.
Comments (6)