Visa Inc. Interview Question

Greedy algorithm to fill up water