#1732 - Find the Highest Altitude
A biker starts a trip at altitude 0 and goes through n + 1 points. You are given an integer array gain of length n, where gain[i] is the net gain in altitude between points i and i + 1. Return the highest altitude reached.
| Input | Output |
|---|---|
gain = [-5,1,5,0,-7] | 1 |
gain = [-4,-3,-2,-1,4,3,2] | 0 |