Code RoomWidest path
MediumPrep Room Coding #1266

Widest path

CodingAlgorithms & data structuresMid–Senior~30 min

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) → int
Examples
in[4,[[0,1,3],[1,3,2],[0,2,4],[2,3,5]],0,3]out4
What 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
InputExpectedGot
[4,[[0,1,3],[1,3,2],[0,2,4],[2,3,5]],0,3]4not run yetsample