Google | Phone | Airplane schedule
Anonymous User
5599

Ask:
a) if its possible to fly from starting airport to ending airport with timing in mind
b) path taken

Input: Starting Airport, Ending Airport, List of Flight Schedule with corresponding flying & landing time (eg (AirportA, 1) -> (AirportB, 4))

eg: can you fly from A to C with following flight schedule:
Flight 1: A,1 -> B,4
Flight 2: B,3 -> C,5
ans: no because you cannot "go back in time". When you land at B, flight 2 has already taken off.

I answered with a BFS.. but seems like the interviewer was looking for something else.

Comments (14)