Search⌘ K
AI Features

Cheapest Flights Within K Stops

Cheapest Flights Within K Stops gives flight prices between cities and a source, destination, and stop limit. Find the minimum travel cost, or return -1 if no route qualifies.

Statement

You are given n cities, numbered from 00 ...