leetcode
42. Trapping Rain Water
Solution
Java code
Python code
Time complexity: O(n)
Space complexity: O(1)