🔥✅✅ Dart Solution 📌📌 || with Explanation 👌👌
Solution
Initialization: Start with the given initialEnergy and initialExperience.
Loop Through Opponents:

For each opponent, calculate the required energy and
# Solution

1. **Initialization**: Start with the given `initialEnergy` and `initialExperience`.
2. **Loop Through Opponents**:
    - For each opponent, calculate the required energy and experience to defeat them. This is simply the opponent's energy plus one and the opponent's experience plus one.
    - Calculate the deficit in energy and experience by subtracting your current energy and experience from the required values.
    - If there is a deficit, add the necessary training hours to your total and update your current energy and experience.
3. **Defeat Opponent**: After ensuring you have enough energy and experience, defeat the opponent by updating your energy and experience.
4. **Return Total Training Hours**: After processing all opponents, return the total number of training hours required.

### Time Complexity

- The time complexity of this solution is **O(n)**, where `n` is the number of opponents. This is because we loop through each opponent once and perform constant-time operations for each.

```dart
class Solution {
  int minNumberOfHours(int initialEnergy, int initialExperience, List<int> energy, List<int> experience) {
    int totalTrainingHours = 0;
    int currentEnergy = initialEnergy;
    int currentExperience = initialExperience;
    for (int i = 0; i < energy.length; i++) {
        int requiredEnergy = energy[i] + 1;
        int requiredExperience = experience[i] + 1;
        int energyDeficit = requiredEnergy - currentEnergy;
        int experienceDeficit = requiredExperience - currentExperience;
        if (energyDeficit > 0) {
            totalTrainingHours += energyDeficit;
            currentEnergy += energyDeficit;
        }
        if (experienceDeficit > 0) {
            totalTrainingHours += experienceDeficit;
            currentExperience += experienceDeficit;
        }
        currentEnergy -= energy[i];
        currentExperience += experience[i];
    }
    return totalTrainingHours;
  }
}
```
['Array', 'Greedy', 'Dart']