Maximum elevation drop
Your task
Your road-trip app records the elevation (in meters, an integer) at each waypoint in order. Riders want to know the biggest single descent available: the largest value of an earlier waypoint's elevation minus a later waypoint's elevation. The two waypoints need not be adjacent, but the higher one must come first. Return that maximum drop, or 0 if the route never descends (or has fewer than two waypoints). For example, [100, 80, 120, 60] gives 60 (120 down to 60).
Examples
biggest_descent(elevations: list[int]) -> intExample 1
Input
biggest_descent([100, 80, 120, 60])Output
60Example 2
Input
biggest_descent([1, 2, 3])Output
0