Imagine you're a professional athlete preparing for the most important competition of your career! ๐โโ๏ธ๐ช
A futuristic sports scientist has provided you with two different energy drinks A and B, each offering varying energy boosts throughout the day. You have n hours to prepare, and you must drink exactly one energy drink per hour to maximize your total energy boost.
Here's the catch: switching between drinks isn't instant! If you want to switch from one energy drink to another, your body needs one full hour to cleanse your system - meaning you get zero energy boost during that transition hour.
Your Goal: Determine the maximum total energy boost you can achieve over n hours. You can start with either drink A or drink B.
Input: Two integer arrays energyDrinkA and energyDrinkB of length n, representing energy boosts per hour.
Output: The maximum total energy boost possible.
Input & Output
Constraints
- n == energyDrinkA.length == energyDrinkB.length
- 1 โค n โค 105
- 1 โค energyDrinkA[i], energyDrinkB[i] โค 105