Input: gain = [-4,-3,-2,-1,4,3,2]
Explanation: Starting at 0. Altitudes are: 0 (initial), 0 + (-4) = -4, -4 + (-3) = -7, -7 + (-2) = -9, -9 + (-1) = -10, -10 + 4 = -6, -6 + 3 = -3, -3 + 2 = -1. The sequence of altitudes is [0, -4, -7, -9, -10, -6, -3, -1]. The highest value in this sequence is 0.