Cheapest Flights Within K Stops

Asked at Uber · Coding Questions · Difficulty: Medium · Last asked Jan 28, 2026

There are `n` cities connected by directed flights. `flights[i] = [from_i, to_i, price_i]`. Given `src`, `dst`, and a stop budget `k`, return the cheapest price from `src` to `dst` using at most `k` stops, or `-1` if no such route exists.

Loading the problem…