You are given two integer arrays energyDrinkA and energyDrinkB, both of length n, representing the energy boost gained from consuming drink A and drink B across n consecutive hours.
During each hour, you can choose to drink either energy drink A or energy drink B:
Consuming energy drink A at hour i provides energyDrinkA[i] energy boost.
Consuming energy drink B at hour i provides energyDrinkB[i] energy boost.
If you choose to switch between drinks, you must spend
Return the maximum total energy boost you can achieve across all n hours.
Constraints:
n == energyDrinkA.length == energyDrinkB.length
n
energyDrinkA[i], energyDrinkB[i]
You are given two integer arrays energyDrinkA and energyDrinkB, both of length n, representing the energy boost gained from consuming drink A and drink B across n consecutive hours.
During each hour, you can choose to drink either energy drink A or energy drink B:
Consuming energy drink A at hour i provides energyDrinkA[i] energy boost.
Consuming energy drink B at hour i provides energyDrinkB[i] energy boost.
If you choose to switch between drinks, you must spend
Return the maximum total energy boost you can achieve across all n hours.
Constraints:
n == energyDrinkA.length == energyDrinkB.length
n
energyDrinkA[i], energyDrinkB[i]