Graph traversalEasy
BFS shortest path
Unweighted graph as an adjacency list g[u] = {v, ...}. Return the number of edges from src to every node, with -1 for unreachable nodes.
Your code0:00
- Tap the first line below, or drag it here.
0 of 90 rebuilt today
Unweighted graph as an adjacency list g[u] = {v, ...}. Return the number of edges from src to every node, with -1 for unreachable nodes.