I have an array [0,5,6,7,8,6,2,9, 0]
Calculate max elavation gained and max descent and total elevation gained.
total gain is 0->8 and 2-> 9 : 15 max gain 0->8 : 8 max descent : 9->0 : 9
how to calculate this?