Getty Images interview question

write the code for "Trapping Water" from LeetCode