Company: AT and T
Difficulty: medium
Flight Recommender System Implement a prototype for a flight recommender system. There are flight_nodes airports indexed from 0 to flight_nodes - 1 and flight_edges flight routes. The i th flight route is a unidirectional flight from flight_from[i] to flight_to[i] and has a cost flight_weight[i] . Given q queries, where each query has three values - the starting city queries[i][0] , the destination city queries[i][1] , and the maximum number of intermediate stops queries[i][2] , for each query, return the cheapest travel cost respecting the given stops constraint or return -1 if no such path exists. Function Description Complete the function getOptimalFlightRates with the following parameters: int flight_nodes: the number of cities int flight_from[flight_edges]: the list of sources of flight routes int flight_to[flight_edges]: the list of flight destinations of flight routes int flight_weight[flight_edges]: list of the associated cost int queries[q][3]: list of user queries Returns: lo