#3273
Minimum Amount of Damage Dealt to Bob
master · 1730 · lc hard +32 · 39.6% accepted · 165 likes · top 19%
Description
You are given integer power and integer arrays damage and health of length n. Enemy i deals damage[i] per second while alive. Each second after enemies attack, Bob deals power damage to one living enemy.
Return the minimum total damage Bob receives before all enemies die.
Code
1
2
3