β back to unit
Easy
# sorting easy
How Many Drops?
The rollercoaster's altitude log shows every moment of the ride β count the stomach-drops! π’
You get the altitudes as nums. Print how many times the value goes DOWN from one reading to the next.
Example:
Input: nums = [10, 20, 15, 25, 5]
Output: 2
10β20 rises, 20β15 drops (1), 15β25 rises, 25β5 drops (2) β that's 2 drops total.
π‘ need a hint?
sort-how-many-drops.pyπ given lines are locked β write your code in between
loading...