Search
⌘K
Get Premium
Leetcode 3273. Minimum Amount of Damage Dealt to Bob
Each enemy requires ceil(health[i]/power) hits and deals damage[i] per second while alive, so total damage equals the weighted sum of completion times. The problem reduces to a single-machine scheduling problem (minimize sum w_j C_j) with processing times = hits and weights = damage, optimally solved by ordering enemies by the ratio damage[i]/hits_i (Smith's rule).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.