← Questions

Cheapest flights within K stops

0
StripeUberCodingLast asked Feb 2026

Given flights as (from, to, price), a source, a destination and an integer k, return the cheapest price from the source to the destination using at most k stops, or -1 if there is no such route.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding