Problem 1199 · Hard

Minimum Time to Build Blocks

Keep the worker times in a min-heap and repeatedly merge the two smallest: the pair finishes at the slower time plus the split.

Open the interactive visualisation