Initialize dist[src] = 0, all others to infinity.
Repeat times: copy to prev, then for each edge , if prev[u] + w < dist[v], set dist[v] = prev[u] + w.
After iterations, return dist[dst] if finite, otherwise return .
The two-array approach ensures you count stops correctly. Each iteration represents one additional flight (edge) in the path.