Potions (Easy Version)
MediumRating 1500CodeforcesHeap / Priority Queue
Approach hintTry it first, then revealHide
Drink every potion while keeping the ones taken in a min-heap; whenever health drops below zero, undo the most harmful potion taken so far. The final heap size is the answer.