Convex Hull
In short: the convex hull of a set of points is the smallest convex polygon that contains every one of them — stretch a rubber band around the points and let go, and it snaps to the hull. Andrew's monotone chain builds it in O(n log n): sort the points once by (x, y), then build two chains — a lower hull scanning left to right and an upper hull scanning right to left. Each chain is a stack: a new point is pushed on, but first, while the top of the stack and the new point do NOT make a left turn, the top point is popped — it would create a dent, so it can't be on the hull. Every point gets pushed once and popped at most once, so the whole walk after sorting is O(n).

Wrapping a boundary around five stops
Five of Meridian's stops sit at (0,0), (1,-1), (2,0), (3,-1) and
(4,0) — already sorted by x. Building the lower hull:
A new point is pushed, but first the stack pops any point that would make a non-left turn with it — a point that would dent the boundary inward never belongs on the hull.
Nothing to compare yet, so (0,0) just goes on. Stack, 1 item. Top is (0,0).
(2, 0) goes on the stack and comes right back off two points later —
pushed once, popped once, never visited again. That's why the whole scan,
after the one O(n log n) sort, costs O(n): the total number of pops across
the entire run can never exceed the total number of pushes.