A network has n nodes (1…n) and directed edges u v w meaning a signal takes w time to travel u → v. A signal starts at node k. Return the time for all nodes to receive it, or -1 if some node never does.
Input
n mu v wkOutput: the total time, or -1.
4 3 2 1 1 2 3 1 3 4 1 2
2
2 1 1 2 1 1
1
2 1 1 2 1 2
-1
Run your code against the sample tests, or Submit to run the full suite.