Algorithm · Snowflake · Hard
Given an array trips of scheduled bus trips, where each trip has the form [departure, arrival, origin, destination], determine the minimum number of buses needed so that every listed trip is served exactly once. A bus leaves station origin at time departure and reaches station destination at time arrival. Before service begins, buses may be placed at any stations. After completing a trip, a bus remains at its destination station and is available starting at its arrival time.…
Checking your access…