edges lists undirected edges between nodes 0..n-1. Return the number of edges on the shortest path from src to dst, or -1 if dst cannot be reached.
Patterns: bfs, graph. Difficulty: medium.
Open in Dryrun