Company: Nutanix_17july

Difficulty: medium

Problem Statement

Delayed Flights Problem Description An airline's route network contains flight_nodes flights numbered 1, 2, ..., flight_nodes . The arrays flight_from[i] and flight_to[i] describe dependencies between flights: each pair [flight_from[i], flight_to[i]] means that flight_from[i] cannot depart until flight_to[i] has landed. Whenever a flight is delayed, every flight that depends on it - directly or through a chain of such dependencies - is delayed too. Given a list of k flights that are delayed from the start, and the dependency network described above, determine every flight that ends up delayed, and return the list sorted by increasing flight number. Function Description Complete the function countDelayedFlights in the editor below. countDelayedFlights has the following parameters: int flight_nodes : the number of flights vector<int> flight_from : the details of the flight dependencies vector<int> flight_to : the details of the flight dependencies vector<int> delayed :

More Nutanix_17july OA questionsInterview experiences