Back to Question

Cheapest Flights Within K Stops

Question Explain

Given $n$ cities and flights, find the cheapest price from a source to a destination with at most $k$ stops. Use a modification of BFS or Bellman-Ford (or Dijkstra with a stop counter).

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.