End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
currentAltitude to 0.highestPoint to currentAltitude.altitudeGain in the gain array.
a. Add altitudeGain to currentAltitude.
b. If currentAltitude is greater than highestPoint, update highestPoint with currentAltitude.highestPoint as the highest altitude reached.