Dijkstra Shortest Path in a Weighted Undirected Graph

Given a weighted undirected graph with n vertices labeled from 0 to n-1, an edge list edges, and vertices source and target, return the shortest-path distance from source to target.

E...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: