Problem 787 · Medium

Cheapest Flights Within K Stops

Dijkstra over (cost, stops, city) states, pruning states dominated by an earlier cheaper pop.

Open the interactive visualisation