3273. Minimum Amount of Damage Dealt to Bob
You are given an integer
power
and two integer arraysdamage
andhealth
, both having lengthn
.Bob has
n
enemies, where enemyi
will deal Bobdamage[i]
points of damage per second while they are alive (i.e.health[i] > 0
).Every second, after the enemies deal damage to Bob, he chooses one of the enemies that is still alive and deals
power
points of damage to them.Determine the minimum total amount of damage points that will be dealt to Bob before all
n
enemies are dead.
1 | class Solution { |