Amazon Interview Question

Question about how to fill buckets.