Problem
Given a network of n nodes, times array of directed edges (u, v, w), and source k, return the minimum time for all nodes to receive the signal. Return -1 if impossible.
References
Difficulty
🟡 Medium
Companies
Amazon, Google, Goldman Sachs
Notes
Language: Java
Standard Dijkstra from source k. Answer is max of all shortest distances. If any node unreachable, return -1.
Problem
Given a network of n nodes, times array of directed edges (u, v, w), and source k, return the minimum time for all nodes to receive the signal. Return -1 if impossible.
References
Difficulty
🟡 Medium
Companies
Amazon, Google, Goldman Sachs
Notes
Language: Java
Standard Dijkstra from source k. Answer is max of all shortest distances. If any node unreachable, return -1.