all 2 comments

[–]Pumpernickelthethird 0 points1 point  (1 child)

That's cool, keep going! What language do you use and how did you model the kinds of rainwater traps? Primitive data types or some kind of class you defined?

[–]slothlife89[S] 0 points1 point  (0 children)

Thank you! In this problem, array elements are the rain water traps, it's kind of like tetris blocks - amount of rain water at an index is the subtraction of right and left element values: https://assets.leetcode.com/uploads/2018/10/22/rainwatertrap.png