LC: 1199. Minimum Time to Build Blocks - spiralgo/algorithms GitHub Wiki

1199. Minimum Time to Build Blocks:

The Essence:

I leave an explanation from LeetCode which makes it easy to understand why this greedy approach is related to the Huffman compression algorithm.

127239357-5ea2ba40-61a3-4afd-b25f-1008b2f27e49 127239361-a7095ae2-2ce2-4de3-ae1c-574eeb2c9277

Details:

For a detailed explanation and implementation please refer to the corresponding PR:

https://github.com/spiralgo/algorithms/pull/391