Search
⌘K

Leetcode 1962. Remove Stones to Minimize the Total

Given an array of pile sizes and k operations each removing floor(pile/2) stones from a chosen pile (possibly the same pile multiple times), minimize the final total by repeatedly applying the operation to the current largest pile — a greedy max-heap (priority queue) approach yields an efficient O((n+k) log n) solution for the given constraints.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.