Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.63 KB

File metadata and controls

39 lines (30 loc) · 1.63 KB

< Previous                  Next >

Related Topics

[Array] [Binary Search]

Hints

Hint 1 What is the range that the answer must fall into?
Hint 2 The answer has to be in the range [0, max(buckets)] (inclusive).
Hint 3 For a number x, is there an efficient way to check if it is possible to make the amount of water in each bucket x.
Hint 4 Let in be the total amount of water that needs to be poured into buckets and out be the total amount of water that needs to be poured out of buckets to make the amount of water in each bucket x. If out - (out * loss) >= in, then it is possible.