You are given n cities, numbered from n flights, where each flight is represented as flights[i]
You are also given three integers:
src: The starting city.
dst: The destination city.
k: The maximum number of stops allowed on the route (i.e., intermediate cities between src and dst).
Your task is to find the minimum possible cost to travel from src to dst using at most k stops (i.e., the route may contain up to k + 1 flights). If there is no valid route from src to dst that uses at most k stops, return
Constraints:
n
flights.length
flights[i].length
There will not be any multiple flights between two cities.
src, dst, k
src dst
You are given n cities, numbered from n flights, where each flight is represented as flights[i]
You are also given three integers:
src: The starting city.
dst: The destination city.
k: The maximum number of stops allowed on the route (i.e., intermediate cities between src and dst).
Your task is to find the minimum possible cost to travel from src to dst using at most k stops (i.e., the route may contain up to k + 1 flights). If there is no valid route from src to dst that uses at most k stops, return
Constraints:
n
flights.length
flights[i].length
There will not be any multiple flights between two cities.
src, dst, k
src dst