Who Rides Which Van

Asked at Whatnot · Coding Questions · Difficulty: Medium

A map gives travel times between stops. Each van drives a fixed route, a sequence of stops, leaving the first stop at a known time; consecutive stops on a route are always joined by an edge of the map, so the van's arrival time at every position on its route is determined. Riders wait at stops. Decide which van each rider takes, and return, for every van, the riders it carries in boarding order.

Loading the problem…