Search
⌘K

Leetcode 2208. Minimum Operations to Halve Array Sum

Given an array of positive integers where an operation halves any chosen element, find the minimum number of operations to reduce the total sum by at least half. This is solved greedily by always halving the current largest element (commonly implemented with a max-heap) and repeating until the required reduction is reached, yielding O(n log n) time.


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.