Widest path
An undirected network on n nodes (0..n-1) has links given as [u, v, c] where c is the link's bandwidth. The bandwidth of a path is its smallest link. Return the maximum-bandwidth (widest) path value from s to t, or -1 if t is unreachable. Constraints: 1 <= n <= 10^4; 1 <= c <= 10^9.
Implement
widest_path(n: int, edges: list[list[int]], s: int, t: int) → intExamples
in
[4,[[0,1,3],[1,3,2],[0,2,4],[2,3,5]],0,3]out4What 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,3],[1,3,2],[0,2,4],[2,3,5]],0,3]4not run yetsample