Widest path capacity
Given a connected undirected graph with n nodes (0..n-1) and edges [u, v, w] where w (a positive integer) is the bandwidth/capacity of that link, return the maximum-bottleneck (widest) path capacity from src to dst: among all paths, the maximum over paths of the minimum edge weight along the path. Return -1 if dst is unreachable from src. You may assume src != dst. Assume 1 <= n <= 5000.
Implement
max_bottleneck_path(n: int, edges: list[list[int]], src: int, dst: int) → intExamples
in
[4,[[0,1,4],[1,3,2],[0,2,3],[2,3,3]],0,3]out3What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 30 min
solution.py
InputExpectedGot
[4,[[0,1,4],[1,3,2],[0,2,3],[2,3,3]],0,3]3not run yetsample