Given a directed graph, find the length of the shortest path from
Input Specification
Bonus: one case will have edges with negative lengths.
A shortest path will always exist.
Output Specification
The length of the shortest path from vertex
Sample Input
Copy
3 3
1 2 1
2 3 2
1 3 5
Sample Output
Copy
3
Take the path
Comments