Mathpix Snip interview question

Leetcode - Trapping rain water