Motorola Solutions Interview Question

Water storage problem from leetcode