Visa Inc. interview question

Greedy algorithm to fill up water