Last Stone Weight
Simulate stone smashing by repeatedly extracting the two heaviest stones using a max-heap.
webcoderspeed.com
7 articles
Simulate stone smashing by repeatedly extracting the two heaviest stones using a max-heap.
Find minimum CPU intervals to schedule tasks with cooldown using a greedy max-heap simulation.
Rearrange a string so no two adjacent characters are the same using a greedy max-heap approach.
Maximize courses taken within deadlines by greedily scheduling and swapping out the longest past course.
Find minimum fuel stops to reach the target by greedily selecting the largest available fuel stations when running low.
Build the longest string with at most 2 consecutive identical characters by always using the most frequent available character.
Minimize max-min of an array by doubling odd numbers and repeatedly halving the max using a max-heap.