A network has n nodes labelled 1 to n, and times[i] = [u, v, w] is a directed edge along which a signal takes w units of time to travel from u to v. A signal is sent from node k. Return the time it takes for every node to receive it, or -1 if some node never does.
Practise this challenge
All coding challenges