Back to problems

Flights

Algorithm · Tradedesk · Medium

Two cities are connected by flights in both directions. A one-way flight takes exactly 100 minutes in either direction. Travelers plan to make a specified number of round trips. Each round trip consists of an outbound flight from the first city to the second, followed by a return flight back to the first. On every leg, they always board the earliest flight they can catch: a flight is available only if its departure time is at least their arrival time at the airport.…

Checking your access…