Question
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).
biggest_descent(elevations: list[int]) → int[[100,80,120,60]]out60[[1,2,3]]out0State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.