Cheapest Flights Within K Stops
MediumLeetCodeShortest Paths & Topological Sort
Approach hintTry it first, then revealHide
The stop limit breaks plain Dijkstra. Run k + 1 rounds of Bellman-Ford relaxation, reading from a copy of the previous round's distances so a single round never chains two flights.