1/33
Loading...
☕Start Coffee Blending
Blend until all coffees ≥ K!
🔒
Loading...
Blend until all coffees ≥ K!
You are a cafe barista. All coffees must have strength at least K to be served to customers. If there are weak coffees, blend the two weakest to make a stronger one. Blending formula: New coffee = weakest + (second weakest × 2) How many blendings are needed for all coffees to reach K?
[1, 2, 3, 9, 10, 12], K = 7
2
1st: pop(1), pop(2) → 1+2×2=5 → [3,5,9,10,12] 2nd: pop(3), pop(5) → 3+5×2=13 → [9,10,12,13] Min 9 ≥ 7, so 2 times