You are preparing to enter a competition against initialEnergy and initialExperience, along with two integer arrays energy and experience, both of length
To defeat opponent i, your current energy must be strictly greater than energy[i], and your current experience must be strictly greater than experience[i].
When you defeat opponent i:
Your energy decreases by energy[i].
Your experience increases by experience[i].
Before starting the competition, you can train for any integer number of hours. In one hour of training, you can choose to increase either your energy by
Return the minimum total number of training hours needed to defeat all
Constraints:
n energy.length experience.length
n
initialEnergy, initialExperience, energy[i], experience[i]
You are preparing to enter a competition against initialEnergy and initialExperience, along with two integer arrays energy and experience, both of length
To defeat opponent i, your current energy must be strictly greater than energy[i], and your current experience must be strictly greater than experience[i].
When you defeat opponent i:
Your energy decreases by energy[i].
Your experience increases by experience[i].
Before starting the competition, you can train for any integer number of hours. In one hour of training, you can choose to increase either your energy by
Return the minimum total number of training hours needed to defeat all
Constraints:
n energy.length experience.length
n
initialEnergy, initialExperience, energy[i], experience[i]