LeetCode 1046. Last Stone Weight
Do as the game. Choose two heaviest stone and do the subtraction.
Do as the game. Choose two heaviest stone and do the subtraction.
Use priority queue to find the largest k numbers. also and their index.
Maintain a Heap that contains only the K biggest the element.
First we need to sort the scores from biggest to smallest.
Calculate the building in lines not by the whole building.