You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.