GovTech interview question

Trapping Rainwater leetcode hard question